QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#567239#9320. Find the Easiest ProblemcogudWA 18ms6980kbC++141.0kb2024-09-16 10:26:152024-09-16 10:26:16

Judging History

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

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

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;
    map<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]++;
        }
        /*for(int i=0;i<='Z'-'A';i++){
          cout<<q[i]<<" ";
        }*/
        //cout<<endl;
        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;
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 6980kb

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: 18ms
memory: 6748kb

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:

O
P
P
A
B
I
N
H
V
A
T
I
F
R
E
C
N
F
I
V
A
B
S
B
A
O
A
E
F
O
F
A
Y
O
H
G
K
Z
B
F
F
D
R
C
U
T
W
I
A
I
J
A
K
L
I
M
C
C
B
A
V
O
F
A
E
A
H
R
B
G
J
O
F
H
D
B
E
A
B
W
H
M
O
I
B
E
F
W
A
E
P
H
F
N
J
Y
K
P
V
X
O
B
P
I
K
X
L
Z
H
Q
B
D
B
T
F
C
B
U
F
L
A
H
T
I
G
A
C
R
G
V
A
N
O
N
K
I
M
R
H
N
J
K
F
K
A
G
N
F
B
H
...

result:

wrong answer 1st lines differ - expected: 'Z', found: 'O'