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. 30.构建单机多容器环境-故障&31.构建单机多容器环境

    主要的命令是docker run .主要是用它来构建容器 关机打开序列化 31.构建单机多容器环境 构建自己单机的多容器 加入我们做一个应用程序 -d是在后台运行,不会阻塞你的命令行 之前有一个空的a ...

  2. gridview把textbox的值修改还是旧值的解决方法

    解决方法很简单,加上if(!IsPostBack) 就OK了,因为之前加载之前都会调用InitData(). protected void Page_Load(object sender, Event ...

  3. JS Guid生成

    function numToGuid(uid) { var str = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"; var l = uid.to ...

  4. 51nod1202【DP-树状数组维护】

    思路: DP[i]代表从1 到 i 以 a[i] 为末尾的子序列个数,dp[i]=dp[i]+dp[j](a[i]!=a[j]) +1 利用树状数组维护以值 a[i] 结尾的子序列个数. #inclu ...

  5. [sdut] 1400 马的走法 dfs

    Problem Description 在一个4*5的棋盘上,马的初始位置坐标(纵 横)位置由键盘输入,求马能返回初始位置的所有不同走法的总数(马走过的位置不能重复,马走“日”字).如果马的初始位置坐 ...

  6. P5346 【XR-1】柯南家族

    题目地址:P5346 [XR-1]柯南家族 Q:官方题解会咕么? A:不会!(大雾 题解环节 首先,我们假设已经求出了 \(n\) 个人聪明程度的排名. \(op = 1\) 是可以 \(O(1)\) ...

  7. spring事物回滚机制 (事务异常回滚,捕获异常不抛出就不会回滚)

    当异常被捕获catch的时候,spring的事物则不会回滚 为什么不会滚呢??  spring aop  异常捕获原理:被拦截的方法需显式抛出异常,并不能经任何处理,这样aop代理才能捕获到方法的异常 ...

  8. RabbitMQ下载安装教程 Windows10

    https://blog.csdn.net/weixin_39735923/article/details/79288578

  9. 如何使用JMeter从文件中提取数据

    在性能测试方面,重用响应数据至关重要.几乎(如果不是全部!)负载测试场景假设您: 从先前的响应中提取有趣的方面,并在下一个请求中重用它们(也称为相关) 确保实际响应符合预期(又称断言) 因此,如果您是 ...

  10. IOS在滚动的时候fixed消失

      前段时间,除了apple发布了新的硬件之外,同步还发布了新的操作系统,IOS11,当大家都将注意力聚焦在那个奇怪的刘海该如何适配的时候,笔者的项目在适配IOS11却出现了其他的问题. 众所周知,I ...