A题,超级大水题,根据有没有1输出-1和1就行了。我沙茶,把%d写成了%n。

B题,也水,两个矩形的长和宽分别加一下,剩下的两个取大的那个,看看是否框得下。

C题,其实也很简单,题目保证了小三角形是正三角形,一个正三角的面积=l*l*(1/2)*cos(30),由于只要算三角形个数,把六边形扩成一个大三角,剪掉三个小三角,除一下系数就没了。就变成了平方相减。

D题,根据定义递归。然后注意奇数就行了。我沙茶,没加第一种判断dfs(a+len,len,b+len) && dfs(a,len,b)。

E题,有思路,没写代码,就是个DP,设当前走到r,c且不经过黑点的方案数为dp[r][c],转移的时候用C(r+c-2,r-1)可以算出从(0,0)点走到(r,c)的方案数,然后减去从之前的黑点走到(r,c)的方案数。

总结,好好读题,仔细敲代码

A题

#define HDU
#ifndef HDU
#include<bits/stdc++.h>
#else
#include<cstdio>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<cstring>
#endif // HDU
using namespace std;
//const int maxn = 1009;
//int n;
//int a[maxn];
int main()
{
#ifdef local
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
#endif // local
int t;
int n;
while(~scanf("%d",&n)){
bool flag = ;
for(int i = ; i < n; i++){
scanf("%d",&t);
if(t == ) flag = ; }
if(flag) printf("-1");
else printf("");
}
return ;
} /*
// for(int i = 0; i < n; i++){
//} scanf("%d",a+i);
sort(a,a+n);
if(a[0] == 1 ){ }else
*/

B题

#define HDU
#ifndef HDU
#include<bits/stdc++.h>
#else
#include<cstdio>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
//#include<iostream>
#endif // HDU
using namespace std; //#define local
#define PY { puts("YES"); return 0; }
#define PN { puts("NO"); return 0; } int main()
{
#ifdef local
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
#endif // local
int a0,b0;
scanf("%d%d",&a0,&b0);
int a1,b1,a2,b2;
scanf("%d%d%d%d",&a1,&b1,&a2,&b2);
int t = (a1+a2),t2 = max(b1,b2);
if((t<=a0 && t2<= b0)|| (t<=b0 && t2<=a0) ) PY;
t = (a1+b2); t2 = max(b1,a2);
if((t<=a0 && t2<= b0)|| (t<=b0 && t2<=a0) ) PY;
t = (b1+a2); t2 = max(a1,b2);
if((t<=a0 && t2<= b0)|| (t<=b0 && t2<=a0) ) PY;
t = (b1+b2); t2 = max(a1,a2);
if((t<=a0 && t2<= b0)|| (t<=b0 && t2<=a0) ) PY;
PN;
return ;
}

C题

#define HDU
#ifndef HDU
#include<bits/stdc++.h>
#else
#include<cstdio>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
//#include<iostream>
#endif // HDU
using namespace std; //#define local int main()
{
#ifdef local
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
#endif // local
int a,b,c,d,e,f,g;
scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f,&g);
int l = a+b+c;
int ans = l*l - a*a - c*c - e*e;
printf("%d",ans);
return ;
}

D题

#define HDU
#ifndef HDU
#include<bits/stdc++.h>
#else
#include<cstdio>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<cstring>
#endif // HDU
using namespace std; //#define local bool dfs(char *a,int len,char *b)
{
if(len == ) { return (*a) == (*b); }
if(memcmp(a,b,len) == ) return true;
if(len&) return false;
len >>= ;
return (dfs(a,len,b+len) && dfs(a+len,len,b))||(dfs(a+len,len,b+len) && dfs(a,len,b));
} const int maxn = +;
char a[maxn],b[maxn]; int main()
{
#ifdef local
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
#endif // local
scanf("%s%s",a,b);
int len = strlen(a);
printf("%s\n",dfs(a,len,b)?"YES":"NO");
return ;
}

Codeforces Round #313 (Div. 2) A.B,C,D,E Currency System in Geraldion Gerald is into Art Gerald's Hexagon Equivalent Strings的更多相关文章

  1. 【打CF,学算法——一星级】Codeforces Round #313 (Div. 2) A. Currency System in Geraldion

    [CF简单介绍] 提交链接:http://codeforces.com/contest/560/problem/A 题面: A. Currency System in Geraldion time l ...

  2. Codeforces Round #313 (Div. 2) A. Currency System in Geraldion

    A. Currency System in Geraldion Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/co ...

  3. Codeforces Round #313 (Div. 2) A. Currency System in Geraldion 水题

    A. Currency System in Geraldion Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/c ...

  4. Codeforces Round #313 (Div. 1) B. Equivalent Strings

    Equivalent Strings Problem's Link: http://codeforces.com/contest/559/problem/B Mean: 给定两个等长串s1,s2,判断 ...

  5. Codeforces Round #313 (Div. 2)B.B. Gerald is into Art

    B. Gerald is into Art Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/ ...

  6. Codeforces Round #313 (Div. 2) D. Equivalent Strings

    D. Equivalent Strings Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/ ...

  7. Codeforces Round #313 (Div. 1) B. Equivalent Strings DFS暴力

    B. Equivalent Strings Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559 ...

  8. Codeforces Round #313 (Div. 2) B. Gerald is into Art 水题

    B. Gerald is into Art Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/560 ...

  9. 【打CF,学算法——二星级】Codeforces Round #313 (Div. 2) B. Gerald is into Art(水题)

    [CF简单介绍] 提交链接:http://codeforces.com/contest/560/problem/B 题面: B. Gerald is into Art time limit per t ...

随机推荐

  1. Spring入门第十二课

    Bean的配置方法 通过工厂方法(静态工厂方法&实例工厂方法),FactoryBean 通过调用静态工厂方法创建Bean 调用静态工厂方法创建Bean是将对象创建的过程封装到静态方法中,当客户 ...

  2. 2018上海大都会 J-Beautiful Numbers(数位dp-模未知)

    J-Beautiful Numbers 链接:https://www.nowcoder.com/acm/contest/163/J 来源:牛客网 时间限制:C/C++ 8秒,其他语言16秒 空间限制: ...

  3. JAVA企业级开发-JavaScript(02)

    一.JavaScript介绍 Javascript语言诞生主要是完成页面的数据验证.因此它运行在客户端,需要运行浏览器来解析执行JavaScript代码. 特点: 交互性(它可以做的就是信息的动态交互 ...

  4. Widows下Faster R-CNN的MATALB配置(CPU)

    目录 1. 准备工作 2. VS2013编译Caffe 3. Faster R-CNN的MATLAB源码测试 说实话,费了很大的劲,在调试的过程中,遇到了很多的问题: 幸运的是,最终还是解决了问题: ...

  5. Unity 自动寻路Navmesh之跳跃,攀爬,斜坡

    在之前的几篇Blog总,我们已经系统学习了自动寻路插件Navmesh的相关概念和细节.然而,如果要做一个场景精美的手游,需要用到各种复杂的场景地形,而不仅仅是平地上的自动寻路.今天我们将通过一个完整的 ...

  6. cf777D(贪心&&c_str()函数)

    题目链接:http://codeforces.com/contest/777/problem/D 题意:给出n行以#开头的字符串,从原字符串尾部删除尽量少的字符串,使其为非降序排列. 思路:我们可以从 ...

  7. 洛谷P1014 Cantor表

    P1014 Cantor表 题目描述 现代数学的著名证明之一是Georg Cantor证明了有理数是可枚举的.他是用下面这一张表来证明这一命题的: 1/1 1/2 1/3 1/4 1/5 … 2/1 ...

  8. Node.js 内置模块fs的readdir方法 查看某个文件夹里面包含的文件内容

    fs.readdir(path[, options], callback) 例: "use strict"; const fs = require("fs"); ...

  9. Python之for循环和while循环

    Python中有两种循环,分别为:for 循环和 while 循环. 循环语句就是在某种条件下,循环的执行某段代码块,并在符合条件的情况下跳出该段循环, 其目的是处理想要进行处理的相同任务.它的关键词 ...

  10. pytest框架(四)

    测试用例setup和teardown 代码示例一 # coding=utf-8 import pytest def setup_module(): print("setup_module:整 ...