QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#572523#9308. World CupHarold0895WA 0ms15356kbC++14970b2024-09-18 15:09:152024-09-18 15:09:16

Judging History

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

  • [2024-09-18 15:09:16]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:15356kb
  • [2024-09-18 15:09:15]
  • 提交

answer

//M
#include<bits/stdc++.h>
using namespace std;
const int mxn=1e5+5;
map<string,int>id;//每道题提交次数
int acc[mxn][30];//每道题提交次数
int ttt[30];
int cnt;
// void create(string name){
//     if(id.count(name)==0)id[name]=++cnt;
// }
void solve(){
    id.clear();
    memset(acc,0,sizeof acc);
    cnt=0;
    memset(ttt,0,sizeof ttt);
    int t;
    cin>>t;
    while(t--){
        string a,b,c;
        cin>>a>>b>>c;
        if(id.count(a)==0)id[a]=++cnt;
        int pp=b[0]-'A';
        if((c[0]=='a')&&(acc[id[a]][pp]==0)){
            acc[id[a]][pp]=1;
            ttt[pp]++;
        }
    }
    int res=0,resi=0;
    for(int i=0;i<26;i++){
        if(ttt[i]>res){
            resi=i;
            res=ttt[i];
        }
    }
    char rr=char('A'+resi);
    cout<<rr<<'\n';
}
int main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int T;
    cin>>T;
    while(T--)solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 15356kb

input:

1
32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

output:

A

result:

wrong output format Expected integer, but "A" found