QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#567169#9320. Find the Easiest ProblemWanderingWA 10ms3596kbC++14660b2024-09-16 09:26:042024-09-16 09:26:04

Judging History

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

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

answer

#include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
using namespace std ;

map<string ,bool> m; 
int cnt[30];
string a, b, c;


void init(){
	m.clear();
	memset(cnt, 0 , sizeof(cnt));
}

void solve(){
	int n; cin >> n;
	for(int i = 1 ; i <= n ; i++){
		cin >> a >> b >> c;
		if(!m[a] && c == "accepted"){
			cnt[int(b[0]) -65]++;
			m[a] = 1;
		}
	}
	
	int maxx = -1, ans = 0;
	for(int i = 0 ; i <= 25 ; i++){
		if(cnt[i] > maxx) maxx = cnt[i], ans = i;
	}
	cout << char(ans+65) << endl; 
}

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int T; cin >>T;
	while(T--){
		init();
		solve();
	}
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 10ms
memory: 3596kb

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'