【April Fools Day Contest 2014A】【愚人节脑洞 猜题意】The Great Game 剪刀石头布
2016-03-19 12:41
567 查看
A. The Great Game
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Two teams meet in The Game World Championship. Some scientists consider this game to be the most intellectually challenging game in the world. You are given two strings describing the teams' actions in the final battle. Figure out who became the champion.
Input
The input contains two strings of equal length (between 2 and 20 characters, inclusive). Each line describes the actions of one team.
Output
Output "TEAM 1 WINS" if the first team won, "TEAM
2 WINS" if the second team won, and "TIE" if there was a tie.
Examples
input
output
input
output
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Two teams meet in The Game World Championship. Some scientists consider this game to be the most intellectually challenging game in the world. You are given two strings describing the teams' actions in the final battle. Figure out who became the champion.
Input
The input contains two strings of equal length (between 2 and 20 characters, inclusive). Each line describes the actions of one team.
Output
Output "TEAM 1 WINS" if the first team won, "TEAM
2 WINS" if the second team won, and "TIE" if there was a tie.
Examples
input
[]()[]8< 8<[]()8<
output
TEAM 2 WINS
input
8<8<() []8<[]
output
TIE
#include<stdio.h> #include<iostream> #include<string.h> #include<string> #include<ctype.h> #include<math.h> #include<set> #include<map> #include<vector> #include<queue> #include<bitset> #include<algorithm> #include<time.h> using namespace std; void fre() { freopen("c://test//input.in", "r", stdin); freopen("c://test//output.out", "w", stdout); } #define MS(x,y) memset(x,y,sizeof(x)) #define MC(x,y) memcpy(x,y,sizeof(x)) #define MP(x,y) make_pair(x,y) #define ls o<<1 #define rs o<<1|1 typedef long long LL; typedef unsigned long long UL; typedef unsigned int UI; template <class T1, class T2>inline void gmax(T1 &a, T2 b) { if (b>a)a = b; } template <class T1, class T2>inline void gmin(T1 &a, T2 b) { if (b<a)a = b; } const int N = 100, M = 0, Z = 1e9 + 7, ms63 = 0x3f3f3f3f; char a , b ; //8< 剪刀 //[] 石头 //() 布 int check() { int ret = 0; for (int i = 0; a[i]; i += 2) { if (a[i] == b[i]); else if (a[i] == '8') { if (b[i] == '[')++ret; if (b[i] == '(')--ret; } else if(a[i]=='[') { if (b[i] == '(')++ret; if (b[i] == '8')--ret; } else { if (b[i] == '8')++ret; if (b[i] == '[')--ret; } } return ret; } int main() { while (~scanf("%s%s", a,b)) { int ans=check(); if (ans == 0)puts("TIE"); else puts(ans > 0 ? "TEAM 1 WINS" : "TEAM 2 WINS"); } return 0; } /* 【trick&&吐槽】 要从题目信息找突破—— this game to be the most intellectually challenging game in the world 并不是括号匹配啊。我个傻叉>_< 【题意】 剪刀石头布,真的很像。 【类型】 脑洞 */
相关文章推荐
- 关于撕逼我们能做什么?
- 招聘行业还有机会吗?
- 【ASC44D】【观察找规律 语言模式识别】Detect Shuffling Method map 头文件识别+特殊关键词法 or 频率哈希法
- 【HDU5524 BC61 div1 B】【SET模拟】Subtrees 二叉树不同子节点树的子树个数
- 【HDU5527 2015长春赛区A】【贪心 特判模拟】Too Rich 最多硬币数支付 因子思想 贪心打补丁
- 【HDU5534 2015长春赛区H】【树上DP转完全背包】Partial Tree 不同度不同权对应最大树权
- 【HDU5538 2015长春赛区 L】【暴力 模拟】 House Building 建筑物表面积 挖补法
- 【HDU5532 2015长春赛区F】【LIS+剪枝】Almost Sorted Array 最多移除一元素后单调 O(n)
- 【HDU5533 2015长春赛区G】【结论题】Dancing Stars on Me 平面图的整点正多边形只有正四边形
- 【HDU5536 2015长春赛区 J】【字典树or暴力】Chip Factory 字典序做法+暴力做法
- 【HDU5550 2015 CCPC 南阳国赛K】【DP 脑洞 好题】 Game Rooms 每层楼一属性,所有人各得其所 数轴映射+同属性区间段整体更新
- 【2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest H】【观察找规律 脑洞 构造】Tourist Guide 关键点作端点最多路径
- 【Codeforces Round 323 (Div 2)D】【暴力 脑洞 插入贡献思想】Once Again... 循环节重复T次后的LIS
- 【2015-2016 ACM-ICPC, NEERC, Northern Subregional Contest C】【脑洞 本质不同实现的转化】Concatenation A串为前缀B串为后缀不同串
- 【2015-2016 ACM-ICPC, NEERC, Northern Subregional Contest D】【脑洞 构造】Distribution in Metagonia 把数以2^p3^
- 【2015-2016 ACM-ICPC, NEERC, Northern Subregional Contest G】【脑洞 拓扑排序 大根堆小根堆极限维护】Graph DAG加k边使得最小拓扑序最大
- 【Educational Codeforces Round 1A】【水题】Tricky Sum 1~n之和减去2的幂
- 【Educational Codeforces Round 1B】【字符串平移 水题】Queries on a String 字符串平移水题
- 【Educational Codeforces Round 1C】【计算几何-极角排序 atan2 long double】Nearest vectors 平面图上原点引出角度最小的两个
- 【Educational Codeforces Round 1D】【DFS 联通块打标记法】Igor In the Museum 联通块内墙的面数