【April Fools Day Contest 2014A】【愚人节脑洞 猜题意】The Great Game 剪刀石头布

在《The Great Game》中,两支团队在世界锦标赛上展开激烈对决。通过输入描述双方行动的字符串,判断哪支队伍赢得比赛。本游戏模仿经典剪刀石头布玩法,提供详细输入输出说明及代码实现。

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

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
[]()[]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[N], b[N];
//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
并不是括号匹配啊。我个傻叉>_<

【题意】
剪刀石头布,真的很像。

【类型】
脑洞

*/



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值