QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#570626#9320. Find the Easiest ProblemcbdsopaWA 18ms3828kbC++141.6kb2024-09-17 16:48:142024-09-17 16:48:17

Judging History

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

  • [2024-09-17 16:48:17]
  • 评测
  • 测评结果:WA
  • 用时:18ms
  • 内存:3828kb
  • [2024-09-17 16:48:14]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define db double
#define file(a) freopen(#a".in", "r", stdin), freopen(#a".out", "w", stdout)
#define sky fflush(stdout)
#define gc getchar
#define pc putchar
namespace IO{
	template<class T>
	inline void read(T &s){
		s = 0;char ch = gc();bool f = 0;
		while(ch < '0' || '9'<ch) {if(ch == '-') f = 1; ch = gc();}
		while('0'<=ch && ch<='9') {s = s * 10 + (ch ^ 48); ch = gc();}
		if(ch == '.'){
			T p = 0.1;ch = gc();
			while('0' <= ch && ch <= '9') {s = s + p * (ch ^ 48);p /= 10;ch = gc();}
		}
		s = f ? -s : s;
	}
	template<class T,class ...A>
	inline void read(T &s,A &...a){
		read(s); read(a...);
	}
	template<class T>
	inline void print(T x){
		if(x<0) {x = -x; pc('-');}
		static char st[40];
		static int top;
		top = 0;
		do{st[++top] = x - x / 10 * 10 + '0';} while(x /= 10);
		while(top) {pc(st[top--]);}
	}
	template<class T,class ...A>
	inline void print(T s,A ...a){
		print(s); print(a...);
	}
};
using IO::read;
using IO::print;
const int N = 1e5;
int n;
std::map<std::string, bool>st;
std::map<char, int>cnt;
inline void solve(){
	read(n);
	cnt.clear();
	st.clear();
	for(int i = 1; i <= n; ++i){
		std::string s, re;
		char ID;
		std::cin >> s >> ID >> re;
		if(re == "accepted"){
			if(st.find(s) == st.end() ){
				st[s] = true;
				++cnt[ID];
			}
		}
	}
	char mx = 0;
	for(char a = 'A'; a <= 'Z'; ++a){
		if(!mx || cnt[a] > cnt[mx]){
			mx = a;
		}
	}
	pc(mx);pc('\n');
}
int main(){
	//file(a);
	int T; read(T);
	while(T--){
		solve();
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 3828kb

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'