QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#579797#9320. Find the Easiest Problemautu_rain#WA 8ms3824kbC++14726b2024-09-21 17:59:272024-09-21 17:59:27

Judging History

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

  • [2024-09-21 17:59:27]
  • 评测
  • 测评结果:WA
  • 用时:8ms
  • 内存:3824kb
  • [2024-09-21 17:59:27]
  • 提交

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<string, int> p;
	for (int i = 0; i < n; i ++ ) {
		string a, b, c;
		cin >> a >> b >> c;
		p[b] ++;
	}
	string ans;
	int mx = 0;
	for (auto e : p)
		if (e.second >= mx) {
			mx = e.second;
			ans = e.first;
		}
	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;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3624kb

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: 8ms
memory: 3824kb

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
P
W
O
B
I
N
J
S
K
T
Z
K
B
X
L
S
K
Q
Y
J
T
I
H
A
R
A
Q
F
O
F
O
S
D
H
G
L
H
S
D
G
D
Q
Y
J
V
W
P
D
O
J
V
T
B
U
N
I
T
C
A
V
W
G
I
G
O
J
J
O
G
I
E
E
M
D
I
L
J
K
P
J
S
U
W
C
E
K
T
S
Y
D
H
L
J
R
W
N
I
E
R
Y
P
F
N
D
V
Y
S
S
R
J
K
Q
G
P
C
E
I
F
T
I
F
E
K
D
U
Q
R
O
V
V
N
N
G
L
R
M
K
E
Z
J
X
Y
K
G
F
V
L
V
K
...

result:

wrong answer 2nd lines differ - expected: 'E', found: 'P'