codeforces April Fools Day Contest 2014 A. The Great Game

这篇博客提供了解决Codeforces April Fools Day Contest 2014中名为'A.TheGreatGame'的题目方法。通过阅读代码,可以了解如何判断两个字符串中括号和8字符的配对情况,从而得出胜负结果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

题目链接:http://codeforces.com/contest/409/problem/A

很水很水的题

 1 ///2014.4.2
 2 ///codeforces April Fools Day Contest 2014 
 3 ///A. The Great Game
 4 
 5 #include <iostream>
 6 #include <cstdio>
 7 #include <string>
 8 using namespace std;
 9 
10 int main()
11 {
12     // freopen("in","r",stdin);
13     // freopen("out","w",stdout);
14     
15     string s1,s2;
16     cin>>s1>>s2;
17     int num = 0;
18     for(int i=0 ; i<s1.length() ; i+=2){
19         if( s1[i] == '(' ){
20             if( s2[i] == '(' )
21                 continue;
22             else if( s2[i] == '8' ){
23                 num++;
24                 continue;
25             }
26             else{
27                 num--;
28                 continue;
29             }
30         }
31         if( s1[i] == '8' ){
32             if( s2[i] == '(' ){
33                 num--;
34                 continue;
35             }
36             else if( s2[i] == '8' ){
37                 continue;
38             }
39             else{
40                 num++;
41                 continue;
42             }
43         }
44         if( s1[i] == '[' ){
45             if( s2[i] == '(' ){
46                 num++;
47                 continue;
48             }
49             else if( s2[i] == '8' ){
50                 num--;
51                 continue;
52             }
53             else{
54                 continue;
55             }
56         }
57     }
58     if( num==0 )
59         cout<<"TIE"<<endl;
60     else if( num<0 )
61         printf("TEAM 2 WINS\n");
62     else
63         printf("TEAM 1 WINS\n");
64     return 0;
65 }

 

转载于:https://www.cnblogs.com/basement-boy/p/3641918.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值