QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#321360 | #6783. Cooking Competition | iee | AC ✓ | 1ms | 3692kb | C++14 | 441b | 2024-02-04 15:38:18 | 2024-02-04 15:38:19 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
void solve() {
int K = 0, T = 0;
int n;
cin >> n;
while (n--) {
int x;
cin >> x;
if (x == 1) K++;
else if (x == 2) T++;
else if (x == 3) K++, T++;
else K--, T--;
}
if (K > T) cout << "Kobayashi" << "\n";
else if (K == T) cout << "Draw" << "\n";
else cout << "Tohru" << "\n";
}
int main() {
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3692kb
input:
3 3 1 2 1 2 2 4 2 3 4
output:
Kobayashi Tohru Draw
result:
ok 3 lines
Test #2:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
100 2 4 3 1 2 5 3 3 3 1 2 6 2 4 2 4 4 3 8 1 4 1 3 2 1 3 2 17 3 4 4 3 4 3 2 1 4 4 4 3 4 4 3 2 2 5 2 4 2 1 4 5 3 2 2 4 4 2 2 3 17 4 3 3 1 3 1 3 1 1 3 2 3 2 3 3 3 2 14 1 2 4 1 3 1 1 3 1 4 1 1 4 3 4 2 3 3 3 10 2 2 4 4 3 1 3 2 3 2 7 2 2 1 1 3 2 2 14 2 1 3 3 2 1 4 4 4 3 4 1 3 3 2 1 3 11 4 4 4 2 2 4 2 4 2 ...
output:
Draw Tohru Draw Tohru Kobayashi Tohru Tohru Tohru Tohru Kobayashi Kobayashi Tohru Tohru Tohru Kobayashi Kobayashi Tohru Kobayashi Draw Kobayashi Draw Tohru Kobayashi Tohru Kobayashi Tohru Tohru Tohru Tohru Tohru Tohru Tohru Tohru Tohru Draw Tohru Tohru Tohru Draw Tohru Draw Kobayashi Kobayashi Kobay...
result:
ok 100 lines