QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#568441#9320. Find the Easiest Problem01_DreamerWA 15ms3840kbC++17993b2024-09-16 16:31:272024-09-16 16:31:28

Judging History

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

  • [2024-09-16 16:31:28]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:3840kb
  • [2024-09-16 16:31:27]
  • 提交

answer

#include<iostream>
#include<unordered_map>
#include<cstring>

using namespace std;
int cnt[30];

unordered_map<string,int>m;


int main()
{
    int T;
    cin>>T;
    
    while(T--)
    {
        memset(cnt,0,sizeof cnt);
        int n;
        cin>>n;
        
        
        char id;
        string team,st;
        while(n--)
        {
            cin>>team>>id>>st;
            
            if(st=="accepted")
            {
                int u=id-'A';
                
                int& a=m[team];
                if(a>>u&1) continue;
                
                a|=1<<u;
                
                cnt[u]++;
            }
            
        }
        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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3840kb

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
A

result:

ok 2 lines

Test #2:

score: -100
Wrong Answer
time: 15ms
memory: 3592kb

input:

1000
44
WaiooyIXa O accepted
WaiooyIXa P accepted
ZYYsNWag P accepted
DPIawQg D rejected
IzPdjnM Z rejected
Ra D rejected
kwQyGxLo I rejected
DPIawQg L accepted
kwQyGxLo I accepted
mmWxDuADCB D rejected
PXwVAOgwiz P rejected
ZYYsNWag U accepted
IzPdjnM Z accepted
TgBNO P rejected
kwQyGxLo J accepted...

output:

Z
E
H
I
B
B
G
H
S
C
M
B
Q
R
A
M
D
B
A
D
G
P
S
P
A
I
A
X
A
E
L
B
V
R
A
A
A
C
A
A
A
A
A
A
A
A
W
C
A
A
A
A
L
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
K
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
...

result:

wrong answer 3rd lines differ - expected: 'Z', found: 'H'