题目链接

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3958

AC代码

#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <numeric>
#include <sstream> using namespace std;
typedef long long LL; const double PI = 3.14159265358979323846264338327;
const double E = 2.718281828459;
const double eps = 1e-6; const int MAXN = 0x3f3f3f3f;
const int MINN = 0xc0c0c0c0;
const int maxn = 1e5 + 5;
const int MOD = 1e9 + 7; int main()
{
int t;
cin >> t;
while (t--)
{
int n;
int a = 0, b = 0;
cin >> n;
int num;
for (int i = 0; i < n; i++)
{
scanf("%d", &num);
if (num == 1)
a++;
else if (num == 2)
b++;
else if (num == 3)
a++, b++;
else if (num == 4)
a--, b--;
}
if (a > b)
cout << "Kobayashi\n";
else if (a == b)
cout << "Draw\n";
else if (a < b)
cout << "Tohru\n";
}
}

ZOJ 3958 Cooking Competition 【水】的更多相关文章

  1. 2017浙江省赛 A - Cooking Competition ZOJ - 3958

    地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3958 题目: "Miss Kobayashi's Drag ...

  2. ZOJ 2723 Semi-Prime ||ZOJ 2060 Fibonacci Again 水水水!

    两题水题: 1.如果一个数能被分解为两个素数的乘积,则称为Semi-Prime,给你一个数,让你判断是不是Semi-Prime数. 2.定义F(0) = 7, F(1) = 11, F(n) = F( ...

  3. CodeForces - 1040B Shashlik Cooking(水题)

    题目: B. Shashlik Cooking time limit per test 1 second memory limit per test 512 megabytes input stand ...

  4. ZOJ 3827 Information Entropy 水

    水 Information Entropy Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge Informati ...

  5. ZOJ 3819 Average Score 水

    水 Average Score Time Limit: 2 Seconds      Memory Limit: 65536 KB Bob is a freshman in Marjar Univer ...

  6. ZOJ Special AC String 水

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3702 题目大意: 对于给定的一个字符串,满足如下要求输出AC,否则WA(好吧我 ...

  7. ZOJ 3168 Sort ZOJ7 水

    再水一发,舍友肿么还在睡T T. ---------------------------------舍友还在睡觉的分割线--------------------------------- http:/ ...

  8. ZOJ 2514 Generate Passwords 水

    啦啦啦,水一发准备去复习功课~ ------------------------------------------水一发的分割线----------------------------------- ...

  9. ZOJ 3827 Information Entropy 水题

    Information Entropy Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.zju.edu.cn/onlinejudge/sh ...

随机推荐

  1. 用@spy模拟真实对象的部分行为

    1.说明在某些情况下,我们需要使用一个真实对象.但是,我们同时需要自定义该对象的部分行 为,此时用@spy 就可以帮我们达到这个目的. 2.用法: categoryService = PowerMoc ...

  2. NSCondition(转)

    NSConditionLock 继承类NSObject 遵从的协议NSLocking NSObject NSConditionLock 类定义特定的.用户定义的条件锁 协议NSLocking 方法 l ...

  3. html+css+JavaScript贪吃蛇

    写文记录一下最近新完成的贪吃蛇游戏案例,用到了html.css和JavaScript,难度不高,适合刚入坑的同学练习,欢迎大家交流. 下面贴源码: <!DOCTYPE html> < ...

  4. CenOS下安装Memcache和PHP Memcache扩展.

    I.安装Memcahce 1. 安装依赖包libevent Memcache需要安装libevent,所以安装前可能需要执行 yum install libevent-devel 2.安装memcac ...

  5. Python tkinter 用键盘移动没反映修改代码

    from tkinter import *   def movetriangle(event):     if event.keysym == 'Up':         canvas.move(a1 ...

  6. constructors and destructors

    A constructor is a method that gets called immediately when an object is allocated (on the stack or ...

  7. VMware虚拟机 Ubuntu 实用技巧 (2)桥接模式连接网络与网卡的配置

    1.先用ifconfig查看当前的网卡配置,一般没有进行设置之前,打印的信息如下所示. ens33 Link encap:以太网 硬件地址 02:0c:29:c6:be:c7 inet6 地址: fe ...

  8. MySQL同步状态双Yes的假象及 seconds_behind_master的含义

    MySQL同步状态双Yes的假象及seconds_behind_master的含义   近期由于特殊原因有一台主库宕机了一个小时没有处理,说起来这是个挺不好啥意思的事情,但是由于这个事情反而发现个比较 ...

  9. SHELL $RANDOM产生的随机数范围是0到32767

    1.使用系统的 $RANDOM 变量 fdipzone@ubuntu:~$ echo $RANDOM 17617 fdipzone@ubuntu:~$ echo $RANDOM 17617 $RAND ...

  10. Snowflake Snow Snowflakes - poj 3349 (hash函数)

    判断n朵雪花中,是否有完全一样的雪花.简单的hash,将雪花的六个边的权值加起来,记为sum,将sum相等的雪花归为一类,再在这里面根据题意找完全相同的,判断顺时针或者逆时针的所有角是否一模一样. # ...