QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#567328#9320. Find the Easiest ProblemcogudWA 1ms6672kbC++14954b2024-09-16 11:08:542024-09-16 11:08:57

Judging History

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

  • [2024-09-16 11:08:57]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:6672kb
  • [2024-09-16 11:08:54]
  • 提交

answer

#include<iostream>
#include<map>
#include<string.h>
#define int long long
using namespace std;
int t,n;
string s1[100005];
char s2[2][15]={"accepted"," rejected"},s3[15];
char c;
int q[28]={0};
signed main(){
    cin>>t;
    while(t--){
        memset(q,0,sizeof(q));
        cin>>n;
    multimap<string, char> mymap;
        for(int i=1;i<=n;i++){
            cin>>s1[i]>>c>>s3;
            if(strcmp(s2[0],s3)==0){
                mymap.insert(pair<string, char>(s1[i],c));
            }
        }
            map<string, char>::iterator it;
        for(it=mymap.begin();it!=mymap.end();it++){
          char p=it->second; 
          int p1=(int)(p-'A');
                q[p1]++;
        }
        int mx=0;
        char m;
        for(int i='Z'-'A';i>=0;i--){
            if(q[i]>=mx){
                mx=q[i];
                m=(char)(i+'A');
            }
        }
        cout<<m<<endl;
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 6672kb

input:

2
5
teamA A accepted
teamB B rejected
teamC A accepted
teamB B accepted
teamD C accepted
4
teamA A rejected
teamB A accepted
teamC B accepted
teamC B accepted

output:

A
B

result:

wrong answer 2nd lines differ - expected: 'A', found: 'B'