Codeforces Round #200 (Div. 2)
2013-09-15 02:12
555 查看
My submissions
8分钟的时候交A题,编译器选错了,然后刷新又得等好久……
C题RE的原因是输入b为1的情况,会有除0的操作,竟然用了20分钟才发现这个问题……
A题代码
B题代码
C题代码
D题代码
题目都太水了,好多人半小时左右就过了四个题目的……
解体报告就懒得写了,这种题目一看代码就能懂的吧。
# | When | Who | Problem | Lang | Verdict | Time | Memory |
---|---|---|---|---|---|---|---|
4467351 | 01:27:52 | hybest | D - Alternating Current | GNU C++ | Accepted | 30 ms | 344 KB |
4465440 | 01:05:14 | hybest | C - Rational Resistance | GNU C++ | Accepted | 30 ms | 0 KB |
4464676 | 00:58:40 | hybest | C - Rational Resistance | GNU C++ | Runtime error on pretest 5 | 0 ms | 0 KB |
4463923 | 00:45:45 | hybest | C - Rational Resistance | GNU C++ | Runtime error on pretest 5 | 30 ms | 0 KB |
4461719 | 00:23:13 | hybest | B - Simple Molecules | GNU C++ | Accepted | 30 ms | 0 KB |
4460074 | 00:10:23 | hybest | A - Magnets | GNU C++ | Accepted | 62 ms | 0 KB |
4459792 | 00:08:45 | hybest | A - Magnets | GNU C | Compilation error | 0 ms | 0 KB |
C题RE的原因是输入b为1的情况,会有除0的操作,竟然用了20分钟才发现这个问题……
A题代码
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<string> #include<stack> #include<map> #include<queue> #include<algorithm> using namespace std; int main() { int n, a, b, res = 0; a = 0 - 1; scanf("%d", &n); while( n-- ) { b = a; scanf("%d", &a); if( a != b) { res++; } } printf("%d\n", res); return 0; }
B题代码
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<string> #include<stack> #include<map> #include<queue> #include<algorithm> using namespace std; int main() { int a, b, c; int aa, bb, cc; scanf("%d %d %d", &a, &b, &c); aa = (b - c + a ) / 2; bb = (c - a + b ) / 2; cc = (a - b + c ) / 2; if( (aa + bb != b) || (bb + cc != c) || (cc + aa != a) || aa < 0 || bb < 0 || cc < 0) { printf("Impossible\n"); return 0; } printf("%d %d %d", aa, bb, cc); return 0; }
C题代码
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<string> #include<stack> #include<map> #include<queue> #include<algorithm> using namespace std; int main() { __int64 a, b, res = 0, temp; scanf("%I64d %I64d", &a, &b); if(a == b) { printf("1\n"); return 0; } if( b == 1) { printf("%I64d\n", a); return 0; } res += a / b; a %= b; while( a != 1 ) { res += b / a; temp = b; b = a; a = temp; a = a % b; } res += b; printf("%I64d\n", res); return 0; }
D题代码
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<string> #include<stack> #include<map> #include<queue> #include<algorithm> using namespace std; char str[100050]; int main() { stack<char>a; scanf("%s", str); int i, l; l = strlen(str); if( l % 2) { printf("No\n"); return 0; } a.push(str[0]); for( i = 1; i < l; i++) { if( a.empty() || str[i] != a.top() ) { a.push(str[i]); } else { a.pop(); } } if( a.empty()) { printf("Yes\n"); return 0; } else { printf("No\n"); } return 0; }
题目都太水了,好多人半小时左右就过了四个题目的……
解体报告就懒得写了,这种题目一看代码就能懂的吧。
相关文章推荐
- Codeforces Round #200 (Div. 1) D. Water Tree
- Codeforces Round #200 (Div. 2)E
- Codeforces Round #200 (Div. 2) (ABCDE题解)
- CodeForces Round 200 Div2
- Codeforces Round #200 (Div. 1) Water Tree (dfs序+线段树)
- Codeforces Round 200 Div1 D Water Tree (树上线段树)
- Codeforces Round #200 (Div. 1)
- Codeforces Round #200 (Div. 1) D. Water Tree(dfs序+线段树)
- Codeforces Round #200 (Div. 1)D Water Tree
- 【Codeforces Round #200 Div.1 E】【JZOJ 5406】 Tree
- codeforces round 200 div2解题报告
- Codeforces Round #200 Div.1 E tree
- Codeforces Round #200 (Div. 1) D - Water Tree 很经典而且很有趣的树 上dfs问题
- Codeforces Round #200 (Div. 1)D. Water Tree 【dfs序+线段树】
- Codeforces Round #200 (Div. 2)
- Codeforces Round #200 (Div. 2)A. Magnets
- Codeforces Round #200 (Div. 1) D.Water Tree
- Codeforces Round #200 (Div. 1)A. Rational Resistance 数学
- Codeforces Round #200 (Div. 1) (树上的线段树)
- Codeforces Round #200 (Div. 2)344D Alternating Current(栈)