QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#576596 | #9320. Find the Easiest Problem | lxpyyds | WA | 0ms | 3620kb | C++14 | 1014b | 2024-09-19 21:11:19 | 2024-09-19 21:11:20 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<string> dp[26];
map<char, int> mymap;
for (char j = 'A'; j <= 'Z'; j++) {
mymap[j] = 0;
}
for (int i = 0; i < n; i++) {
string a, c;
char b;
cin >> a >> b >> c;
if (c == "accepted") {
if (find(dp[b - 'A'].begin(), dp[b - 'A'].end(), a) == dp[b - 'A'].end()) {
mymap[b]++;
dp[b - 'A'].push_back(a);
}
}
}
char minChar = 'A';
int minCount = INT_MAX;
for (char i = 'A'; i <= 'Z'; i++) {
if (mymap[i] < minCount) {
minCount = mymap[i];
minChar = i;
}
}
cout << minChar << endl;
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3620kb
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:
D C
result:
wrong answer 1st lines differ - expected: 'A', found: 'D'