ZOJ3958-Cooking Competition

来源:互联网 发布:怎么在淘宝看直播 编辑:程序博客网 时间:2024/06/08 14:24

Cooking Competition

Time Limit: 1 Second      Memory Limit: 65536 KB

"Miss Kobayashi's Dragon Maid" is a Japanese manga series written and illustrated by Coolkyoushinja. An anime television series produced by Kyoto Animation aired in Japan between January and April 2017.

In episode 8, two main characters, Kobayashi and Tohru, challenged each other to a cook-off to decide who would make a lunchbox for Kanna's field trip. In order to decide who is the winner, they asked n people to taste their food, and changed their scores according to the feedback given by those people.

There are only four types of feedback. The types of feedback and the changes of score are given in the following table.

TypeFeedbackScore Change
(Kobayashi)Score Change
(Tohru)1Kobayashi cooks better+102Tohru cooks better0+13Both of them are good at cooking+1+14Both of them are bad at cooking-1-1

Given the types of the feedback of these n people, can you find out the winner of the cooking competition (given that the initial score of Kobayashi and Tohru are both 0)?

Input

There are multiple test cases. The first line of input contains an integer T (1 ≤ T ≤ 100), indicating the number of test cases. For each test case:

The first line contains an integer n (1 ≤ n ≤ 20), its meaning is shown above.

The next line contains n integers a1a2, ... , an (1 ≤ ai ≤ 4), indicating the types of the feedback given by these n people.

Output

For each test case output one line. If Kobayashi gets a higher score, output "Kobayashi" (without the quotes). If Tohru gets a higher score, output "Tohru" (without the quotes). If Kobayashi's score is equal to that of Tohru's, output "Draw" (without the quotes).

Sample Input

231 2 123 4

Sample Output

KobayashiDraw

Hint

For the first test case, Kobayashi gets 1 + 0 + 1 = 2 points, while Tohru gets 0 + 1 + 0 = 1 point. So the winner is Kobayashi.

For the second test case, Kobayashi gets 1 - 1 = 0 point, while Tohru gets 1 - 1 = 0 point. So it's a draw.


Author: WENG, Caizhi
Source: The 14th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple


题意:有四种给分方式,问谁的分数高

解题思路:模拟


#include <iostream>#include <cstdio>#include <cstring>#include <string>#include <algorithm>#include <cmath>#include <map>#include <set>#include <stack>#include <queue>#include <vector>#include <bitset>using namespace std;#define LL long longconst int INF = 0x3f3f3f3f;int a[6] = { 0,1,0,1,-1 };int b[6] = { 0,0,1,1,-1 };int main(){int t;scanf("%d", &t);while (t--){int x,n;int ans1 = 0, ans2 = 0;scanf("%d", &n);for (int i = 1; i <= n; i++){scanf("%d", &x);ans1 += a[x];ans2 += b[x];}if (ans1 > ans2) printf("Kobayashi\n");else if (ans1 < ans2) printf("Tohru\n");else printf("Draw\n");}return 0;}

0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 电脑杀毒之后开不了机怎么办 夫妻离婚分房分车怎么办 请的护身符丢了怎么办 老车轻微烧机油怎么办 电脑下软件变卡怎么办 机械表日历偏了怎么办 子宫内膜异位痛经怎么办 凉着了坏肚子怎么办 昆虫叮咬后疼痛起水泡怎么办 每次来月经都痛经怎么办 人左肩的灯灭了怎么办 香港超过7天了怎么办? 手机拍完照图像是倒的怎么办 地下城金币邮寄卡了怎么办 wow7.3打团本卡怎么办 上古卷轴5出bug怎么办 苹果手机打游戏太卡怎么办 梦幻将军令换了怎么办 手机丢了将军令怎么办 大军之印放弃了怎么办 联想一体机进入界面就死机怎么办 nmd袜子鞋露脚趾怎么办 生意不顺意志崩溃了怎么办 笔记本突然卡住不动了怎么办 指定货代费用高怎么办 空运舱单上的收货人错了怎么办? 被诚信贷骗了怎么办 原户主不迁户口怎么办 二手房原房主没迁走怎么办 办退工没有就失业证怎么办 消防队教导员插手商场翘柜台怎么办 调动工作原单位领导不放人怎么办 脚碰了一下肿了怎么办 六十岁的犯人身体有病怎么办 比熊肛门周围发炎怎么办 夏天肛门周围皮肤发炎怎么办 直肠息肉手术后便秘怎么办 痔疮手术后肛门洞怎么办 痔手术后肛门有个洞怎么办 直肠上长了瘤怎么办 上嘴唇没有唇峰怎么办