QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#572160#9320. Find the Easiest ProblemOIer_kzcWA 13ms3800kbC++14822b2024-09-18 12:42:442024-09-18 12:42:44

Judging History

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

  • [2024-09-18 12:42:44]
  • 评测
  • 测评结果:WA
  • 用时:13ms
  • 内存:3800kb
  • [2024-09-18 12:42:44]
  • 提交

answer

#include <stdio.h>
#include <string.h>

#include <map>
#include <vector>
#include <iostream>
#include <algorithm>

#define LOG(FMT...) fprintf(stderr, FMT)

#define eb emplace_back

using namespace std;

typedef long long LL;
constexpr int N = 305, M = 1005;

int n;
map<string, vector<string>> s;

int main() {
	cin.tie(0)->sync_with_stdio(false);
	int task;
	for (cin >> task; task--; ) {
		cin >> n;
		for (int i = 0; i < n; ++i) {
			string a, b, c;
			cin >> a >> b >> c;
			if (c == "accepted") {
				s[b].eb(a);
			}
		}
		int mx = 0;
		string res = "A";
		for (auto &[a, v] : s) {
			sort(v.begin(), v.end());
			v.erase(unique(v.begin(), v.end()), v.end());
			if ((int)v.size() > mx) {
				mx = v.size();
				res = a;
			}
		}
		cout << res << '\n';
	}
	return 0;
}

详细

Test #1:

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

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: 13ms
memory: 3672kb

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
P
H
H
H
Z
H
H
H
H
H
H
H
H
H
J
F
F
D
D
D
D
D
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
...

result:

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