# Uchiha_Itachi 的博客

### 题解 CF409A 【The Great Game】

posted on 2018-12-12 22:22:12 | under 题解 |

（小声BB）这题怎么才有红题难度QAQ不符合常理QAQ至多也就一个 $\tiny\color{#f00}\text{入门-}$ 而已

$8\!<$ 是剪刀， $[\,]$ 是布， $\{\,\}$ 是剪刀。

void read_one_char(void)
{
char ch;
ch = cin.get();//读一个字符
cin.get();//丢掉
}

$code:$

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <utility>
#include <map>
#define until(x) while(!(x))
using namespace std;

map<pair<char,char>,int> mp;

void init()
{
pair<char,char> chs[9] = {{'[','['},{'[','('},{'[','8'},
{'(','['},{'(','('},{'(','8'},
{'8','['},{'8','('},{'8','8'}};
mp[chs[0]] = mp[chs[4]] = mp[chs[8]] = -1;//TIE
mp[chs[1]] = mp[chs[5]] = mp[chs[6]] = 1;//1 win
mp[chs[2]] = mp[chs[3]] = mp[chs[7]] = 0;//2 win
return;
}
//这题还真是毒瘤

int main()
{
init();
vector<char> action[2];
char ch;
ch = cin.get();
for(;ch != '\n';)
{
action[0].push_back(ch);//当前动作
cin.get();//吃掉下一个字符
ch = cin.get();//更新
}
ch = cin.get();
for(;ch != '\n';)
{
action[1].push_back(ch);
cin.get();
ch = cin.get();//同上
}
int win1 = 1,win2 = -1;
for(int i = 0;i < action[1].size();i++)
{
pair<char,char> p = {action[0][i],action[1][i]};
if(mp[p] == 1)
{
win1++;
}
else if(mp[p] == 0)
{
win2++;
}
}
if(win1 == win2)//赢得一样多
cout << "TIE" << endl;
else if(win1 > win2)//一队赢的多
cout << "TEAM 1 WINS" << endl;
else if(win1 < win2)//二队赢得多
cout << "TEAM 2 WINS" << endl;
return 0;
}
//代码相比AC代码有修改，直接抄会爆0