QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#360263#6783. Cooking CompetitionXiangmy#AC ✓1ms3708kbC++20468b2024-03-21 16:24:522024-03-21 16:24:52

Judging History

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

  • [2024-03-21 16:24:52]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3708kb
  • [2024-03-21 16:24:52]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    int sc1[10]={1,0,1,-1};
    int sc2[10]={0,1,1,-1};
    cin>>n;
    while(n--){
        int b,way,k=0,t=0;
        cin>>b;
        for(int i=1;i<=b;i++){
            cin>>way;
            k+=sc1[way-1];t+=sc2[way-1];
        }
        if(k==t){cout<<"Draw"<<endl;}
        else if(k>t){cout<<"Kobayashi"<<endl;}
        else if(k<t){cout<<"Tohru"<<endl;}
    }
    return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 3708kb

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