QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#568423#9320. Find the Easiest Problem01_DreamerWA 0ms3608kbC++17668b2024-09-16 16:25:342024-09-16 16:25:35

Judging History

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

  • [2024-09-16 16:25:35]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3608kb
  • [2024-09-16 16:25:34]
  • 提交

answer

#include<iostream>
#include<cstring>

using namespace std;
int cnt[30];


int main()
{
    int T;
    cin>>T;
    
    while(T--)
    {
        memset(cnt,0,sizeof cnt);
        int n;
        cin>>n;
        
        char id;
        string st;
        while(n--)
        {
            cin>>st>>id>>st;
            if(st=="accepted") cnt[id-'A']++;
        }
        int maxv=-2e9,max_pos=-1;
        for(int i=0;i<26;i++)
           if(cnt[i]>maxv)
           {
               maxv=cnt[i];
               max_pos=i;
           }
        
        char res='A'+max_pos;
        cout<<res<<endl;   
    }
    
    
    return 0;
}

詳細信息

Test #1:

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

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'