QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#184098#6783. Cooking Competitionucup-team004#AC ✓1ms3436kbC++20584b2023-09-20 12:42:482023-09-20 12:42:50

Judging History

你现在查看的是最新测评结果

  • [2023-09-20 12:42:50]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3436kb
  • [2023-09-20 12:42:48]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;

void solve() {
    int n;
    std::cin >> n;
    
    int s = 0;
    for (int i = 0; i < n; i++) {
        int a;
        std::cin >> a;
        if (a == 1) {
            s++;
        } else if (a == 2) {
            s--;
        }
    }
    
    std::cout << (s > 0 ? "Kobayashi" : s < 0 ? "Tohru" : "Draw") << "\n";
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int t;
    std::cin >> t;
    
    while (t--) {
        solve();
    }
    
    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3436kb

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: 0ms
memory: 3384kb

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