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. L2-013. 红色警报 (并查集)

    战争中保持各个城市间的连通性非常重要.本题要求你编写一个报警程序,当失去一个城市导致国家被分裂为多个无法连通的区域时,就发出红色警报.注意:若该国本来就不完全连通,是分裂的k个区域,而失去一个城市并不 ...

  2. UVaLive 4727 Jump (递推)

    题意:约瑟夫环,求最后三个数. 析:f[i] = (f[i-1] + k) % i 这是求最后一个数时候,我们倒着推到第一个数时,只有一个数,所以当只有两个数时,就是另一数, 同理,我们可以求得第三个 ...

  3. MS SQL的CASE...WHEN...THEN...END语法

    根据多个可能的答案检查一个值或变量. 举例说明: SELECT [type],CASE [type] WHEN 'TT' THEN 'TYPE_TABLE' WHEN 'FN' THEN 'SQL_S ...

  4. Automake使用(初级)

    工程地址 https://github.com/silvermagic/automakeDev.git 最初工程目录结构 $ vim main.cpp $ vim src/main.cpp ls -l ...

  5. 327. Count of Range Sum(inplace_marge)

    Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Ra ...

  6. java使用Robot类在eclipse上实现自动编写代码

    运行时,把输入法关掉,切换成系统自带的输入法即可: 第二个类是自定义的键值Map集合,主要是为了方便输入字符串,有需要的可以自行添加: 主要的代码如下,会创建一个名称为Automaton.java的类 ...

  7. Eclipse集成Git的实践

    最近一直在研究爬虫的相关技术,网上关于爬虫的教程实在是太少了,只能靠一些零零散散的博客资料做一个浅度的学习,我们已经学习了webcollector,htmlparser,Jsoup这些爬虫技术,并也成 ...

  8. 黑马MyBatis入门day1

    package com.itheima.domain; /* CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username ...

  9. CentOS与Ubuntu修改主机名

    CentOS 1.执行hostname查看主机名 2.hostname + 主机名  使需要修改的主机名立即生效,但是下次重启会失效,故需要执行第三步 3.vim /etc/sysconfig/net ...

  10. 维护gcd的线段树 补发一波。。。

    基础线段树(辣鸡的不行) 发现自己线段树除了会维护加法和乘法就啥也不会了QWQ太菜了 瞎写了一个维护gcd的 首先,gcd(x,y)= gcd(x,y-x) 并且很容易推广到n个数,所以我们可以把原数 ...