QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#579815#9320. Find the Easiest Problemautu_rain#WA 3ms3832kbC++14827b2024-09-21 18:08:202024-09-21 18:08:21

Judging History

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

  • [2024-09-21 18:08:21]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3832kb
  • [2024-09-21 18:08:20]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define int long long
typedef long long i64;
typedef __int128 i128;
typedef pair<int, int> pII;
#define x first
#define y second
const int N = 2e5 + 10, M = 1e6 + 10, mod = 998244353;
int t, n, m, a[N], b[N];
pII c[N];

void solve() {
	cin >> n;
	unordered_map<char, int> p;
	set<string> s[26];
	for (int i = 0; i < n; i ++ ) {
		string a, c;
		char b;
		cin >> a >> b >> c;
		if (s[b - 'A'].count(a)) continue;
		p[b] ++; s[b - 'A'].insert(a);
	}
	char ans = 'Z';
	int mx = 0;
	for (auto e : p)
		if (e.second >= mx) {
			mx = e.second;
			ans = min(e.first, ans);
		}
	cout << ans << endl;
}
signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);
	cin >> t;
	//t = 1;
	while (t -- ) solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 3ms
memory: 3548kb

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:

A
E
A
F
A
I
A
D
B
G
C
D
F
B
B
C
B
A
A
C
A
B
A
B
A
A
A
B
A
A
A
A
B
A
B
A
H
E
C
A
C
D
A
A
E
I
H
A
C
O
J
A
D
B
E
E
B
J
C
A
B
F
H
A
B
O
C
F
H
G
C
B
B
A
A
C
J
A
B
B
A
A
B
D
B
A
F
A
G
B
C
F
A
E
C
I
A
B
E
C
H
A
F
B
A
A
D
A
A
B
F
A
K
F
A
A
B
A
B
D
H
A
D
F
B
A
F
B
D
B
F
A
A
B
G
C
A
J
E
B
D
D
B
E
A
F
B
C
A
G
...

result:

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