BestCoder Round #65
来源:互联网 发布:薛之谦人品知乎 编辑:程序博客网 时间:2024/05/21 19:24
BestCoder Round #65
HDU 5590 - 5594 通过数:2
1001:
水题,一个个判断即可。
#include <cstdio>#include <cstring>#include <cstdlib>#include <cmath>#include <string>#include <iostream>#include <algorithm>using namespace std;const int MAXN = 100 + 5;char s1[MAXN], s2[MAXN];int main(){ int T; scanf("%d", &T); while(T--){ int n; scanf("%d", &n); scanf("%s %s", s1, s2); int ok = 1; for(int i = 0 ; i < n ; i++){ if(s1[i] == 'A' && s2[i] != 'U') ok = 0; else if(s1[i] == 'T' && s2[i] != 'A') ok = 0; else if(s1[i] == 'C' && s2[i] != 'G') ok = 0; else if(s1[i] == 'G' && s2[i] != 'C') ok = 0; else if(s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') ok = 0; else if(s2[i] != 'A' && s2[i] != 'U' && s2[i] != 'C' && s2[i] != 'G') ok = 0; if(ok == 0) break; } if(ok) printf("YES\n"); else printf("NO\n"); } return 0;}
1002:
用刚学的SG函数证了半天。
就是把x看成一个分割,然后两边分别得到(x - 1), (n - x - 1)两个长度的石子。操作可以到任意一位所以sg[i] = i。
然后….
结果它奇数输出1,偶数输出0….
#include <cstdio>#include <cstring>#include <cstdlib>#include <cstring>#include <algorithm>#include <iostream>#include <string>using namespace std;int main(){ int T; scanf("%d", &T); while(T--){ int u; scanf("%d", &u); if(u == 1){ printf("1\n"); continue; } int ans; if(u % 2 == 1) ans = 1; else ans = 0; printf("%d\n", ans); } return 0;}
1003: HDU 5592线段树 另写 http://blog.csdn.net/beihai2013/article/details/50197455
1004: HDU 5593树形DP 另写 http://blog.csdn.net/beihai2013/article/details/50197459
0 0
- BestCoder Round #65
- BestCoder Round #65
- BestCoder Round #65
- BestCoder Round #65
- BestCoder Round #65 ZYB's Biology
- BestCoder Round #65 ZYB's Game
- BestCoder Round #65 ZYB's Premutation
- hdu 5591 BestCoder Round #65(博弈)
- hdu5592&bestcoder Round #65 1003题
- hdu 5592 BestCoder Round #65 1003
- 【字符串】HDU5590ZYB's Biology【BestCoder Round #65】
- BestCoder Round #65 ZYB's Game
- BestCoder Round #3 BestCoder Sequence
- bestcoder round #1
- BestCoder round #1
- BestCoder Round #1
- 【索引】BestCoder Round #2
- BestCoder Round #2
- hdu 5592 线段树
- HDU 5592 线段树
- 解析自动化测试的理解误区
- 学习Golang的步骤建议
- 模板大全
- BestCoder Round #65
- 中缀表达式,前缀表达式,后缀表达式
- JUnit的jar包和hamcrest的jar包关系
- python随机数整理
- hdu 1350 Taxi Cab Scheme(二分匹配)
- Execution default-testResources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:testReso
- [探测与发现]星际之门计划
- 新版本的 Xcode 7+ Alcatraz 插件安装
- Objective-C消息模式