QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#567867 | #9320. Find the Easiest Problem | wangf_916 | WA | 13ms | 3780kb | C++20 | 1017b | 2024-09-16 14:21:28 | 2024-09-16 14:21:28 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define pb push_back
#define all(x) (x).begin(), (x).end()
using ll = long long;
using ull = unsigned long long;
struct AAA
{
string s1;
char s2;
string s3;
};
void solve() {
int n;
cin >> n;
map<pair<string, char>, int> mp;
map<char, int> mp2;
int mx = -1;
char ans = 'A';
vector<AAA> vec(n);
for (int i = 0; i < n; i ++) {
cin >> vec[i].s1 >> vec[i].s2 >> vec[i].s3;
if(vec[i].s3 == "accepted") {
pair<string, char> z;
z.first = vec[i].s1;
z.second = vec[i].s2;
mp[z] ++;
if(mp[z] == 1) {
mp2[vec[i].s2] ++;
if(mp2[vec[i].s2] >= mx) {
if(mp2[vec[i].s2] == mx) {
if(vec[i].s2 < ans) {
ans = vec[i].s2;
}
}
} else {
ans = vec[i].s2;
}
}
}
}
cout << ans << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int tt;
cin >> tt;
while (tt--) {
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3780kb
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: 3576kb
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 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 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 1st lines differ - expected: 'Z', found: 'A'