codeforces:A. The Great Game
2014-04-04 20:07
423 查看
打开题目链接
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.
Sample test(s)
input
output
input
output
对于此题表示自己看的时候没有看懂是什么意思,看了一下别人的题解,是石头、剪刀、布。
AC code:
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.
Sample test(s)
input
[]()[]8< 8<[]()8<
output
TEAM 2 WINS
input
8<8<() []8<[]
output
TIE
对于此题表示自己看的时候没有看懂是什么意思,看了一下别人的题解,是石头、剪刀、布。
AC code:
/* To this question,i am speechless. looking other solutions,i don't known the sample test. */ #include <string.h> #include <iostream> using namespace std; int main(){ char str1[20],str2[20]; while(cin>>str1>>str2) { int num1=0,num2=0; int l1 = strlen(str1); int l2 = strlen(str2); for(int i=0;i<l1;i+=2){ if((str1[i]=='8' && str2[i]=='[')|| (str1[i]=='[' &&str2[i]=='(') || (str1[i]=='('&&str2[i]=='8')) num1++; else if((str2[i]=='8' && str1[i]=='[')|| (str2[i]=='[' &&str1[i]=='(') || (str2[i]=='('&&str1[i]=='8')) num2++; } if(num1>num2) cout<<"TEAM 1 WINS"<<endl; else if(num2>num1) cout<<"TEAM 2 WINS"<<endl; else cout<<"TIE"<<endl; } return 0; }
相关文章推荐
- codeforces April Fools Day Contest 2014 A. The Great Game
- CodeForces - 834C. The Meaningless Game
- Codeforces 451C Predict Outcome of the Game(暴力)
- codeforces 258div2C Predict Outcome of the Game
- Codeforces 842A. Kirill And The Game (暴力)
- (CodeForces 883A) The Meaningless Game 纯正的数学思维题(有点卡cin时间)
- Uva-1045-The Great Wall Game
- codeforces April Fools Day Contest 2014 A. The Great Game
- Codeforces 842 A Kirill And The Game
- CF - 409 - A. The Great Game(IQ)
- Codeforces 549C. The Game Of Parity 博弈
- CodeForces 833 A.The Meaningless Game(水~)
- codeforces 834 C The Meaningless Game
- (codeforces) The Great Mixing
- codeforces 294E Shaass the Great (树形dp,好题)
- codeforces 788C The Great Mixing (bitset优化dp、bfs)
- CodeForces 834C - The Meaningless Game | Codeforces Round #426 (Div. 2)
- Codeforces 813 C The Tag Game
- UVA-1045 - The Great Wall Game(二分图最佳匹配)
- Codeforces 839B-Game of the Rows