ZOJ 3958 Cooking Competition【】
来源:互联网 发布:决胜60秒源码 编辑:程序博客网 时间:2024/06/05 03:54
"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.
(Kobayashi)
(Tohru)
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 a1, a2, ... , 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.
#include <iostream>#include<cstdio>#include<cmath>#include<string>#include<cstring>#include<queue>#include<stack>using namespace std;int i,j,k,b,n,m;int main(){ int T; int sum1,sum2; scanf("%d",&T); while(T--){ sum1=sum2=0; scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%d",&k); if(k==1)sum1++; if(k==2)sum2++; } if(sum1==sum2)printf("Draw\n"); else if(sum1>sum2)printf("Kobayashi\n"); else printf("Tohru\n"); } return 0;}
- ZOJ 3958 Cooking Competition
- ZOJ 3958 Cooking Competition【】
- zoj 3958 Cooking Competition
- ZOJ 3958Cooking Competition
- ZOJ 3958 Cooking Competition 题解
- Cooking Competition
- Cooking Competition
- Cooking Competition
- ZOJ3958-Cooking Competition
- ZOJ3958 Cooking Competition
- Cooking
- cooking
- Competition
- cooking处理
- Cooking 笔记
- FOOD COOKING
- Cooking food
- 【题解】cooking
- web本地存储(localStorage、sessionStorage)
- PCIE_DMA实例一:xapp1052详细使用说明
- System::String转换为std::string
- 创建登录用户并授权
- 算法细节系列(12):破除想当然
- ZOJ 3958 Cooking Competition【】
- CG类型
- Virtualbox 下配置高版本Linux内核的增强包安装
- MySQL数据安全技术
- MySQL日常总结
- PHP面试笔试细节
- Android 开发中如何用Javah命令生成JNI头文件
- 字体应用
- MySQL数据库安全技术