算法竞赛入门经典第四章习题4-4 Cube painting UVA - 253
2018-01-05 00:11
363 查看
习题4-4
https://vjudge.net/problem/UVA-253
https://vjudge.net/problem/UVA-253
#include<iostream> #include<string> #include<cstring> #pragma warning(disable:4996) using namespace std; int main() { #ifdef _DEBUG //freopen("in", "rb", stdin); //freopen("out", "wb", stdout); #endif // _DEBUG string A[24] = { "123456","135246","154326","142536", "214365","246135","263415","231645", "312564","326154","365214","351624", "421653","415263","456123","462513", "513462","536142","564312","541632", "624351","645231","653421","632541" }; string s, t; while (cin >> s) { bool is_true=false; t = string(s, 0, 6); s = string(s, 6, 12); for (int i = 0; i < 24; ++i) { is_true = true; for(int j=0;j<6;++j) if (t[j] != s[A[i][j] - '1']) { is_true = false; break; } if (is_true) break; } if (is_true) cout << "TRUE" << endl; else cout << "FALSE" << endl; } }
相关文章推荐
- 算法竞赛入门经典第四章习题4-1 Xiangqi UVA - 1589
- 算法竞赛入门经典第四章习题4-9 Data Mining UVA - 1591
- 算法竞赛入门经典第四章习题4-7 RAID! UVA - 509
- 算法竞赛入门经典第四章习题4-8 Extraordinarily Tired Students UVA - 12108
- 算法竞赛入门经典 第二版 习题9-2 免费糖果 Free Candies uva10118
- 算法竞赛入门经典 第二版 习题6-2 S树 S-Trees uva712
- 算法竞赛入门经典-习题3-6 纵横字谜的答案(Crossword Answers, ACM/ICPC World Finals 1994,UVa232)
- 算法竞赛入门经典 习题3-1 得分(Score, ACM/ICPC Seoul 2005, UVa1585)
- 算法竞赛入门经典习题3-1 得分(Score,ACM/ICPC Seoul2005,UVa1585)
- 算法竞赛入门经典第四章例题4-2 Hangman Judge UVA - 489
- 算法竞赛入门经典-习题3-2 分子量(Molar Mass, ACM/ICPC Seoul 2007, UVa1586)
- 排列 permutation 算法竞赛入门经典第二版 习题2-6
- 算法竞赛入门经典 习题3-7 n进制转十进制
- [刷题]算法竞赛入门经典 3-1/UVa1585 3-2/UVa1586 3-3/UVa1225
- 算法竞赛入门经典-习题3-4 周期串(Periodic Strings, UVa455)
- 算法竞赛入门经典3.2 分子量UVa1586
- UVa1586 分子量 算法竞赛入门经典第二版CH-3习题3-2
- [算法竞赛入门经典] UVA 1152 - 4 Values whose Sum is 0 | POJ 2785
- 算法竞赛入门经典 第二版 例题11-4 电话圈 Calling Circles uva247
- [算法竞赛入门经典] UVA 714 - Copying Books