QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#569895 | #9320. Find the Easiest Problem | yuk11119 | WA | 15ms | 3656kb | C++17 | 692b | 2024-09-17 11:56:49 | 2024-09-17 11:56:51 |
Judging History
answer
#include <iostream>
#include <cstring>
#include <algorithm>
#include <map>
using namespace std;
int n, T, cnt[27];
map<pair<int, int>, bool> mp;
string s;
int main()
{
cin >> T;
while(T--)
{
memset(cnt, 0, sizeof(cnt));
mp.clear();
cin >> n;
getchar();
for(int i = 0; i < n; i++)
{
getline(cin, s);
if(s[8] == 'r') continue;
else if(mp[{s[6] - 'A', s[4] - 'A'}] == false)
{
cnt[s[6] - 'A']++;
mp[{s[6] - 'A', s[4] - 'A'}] = true;
}
}
int ans = 0, idx;
for(int i = 0; i < 26; i++)
{
if(cnt[i] > ans)
{
ans = cnt[i];
idx = i;
}
}
cout << (char)(idx + 'A') << endl;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3656kb
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: 15ms
memory: 3624kb
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 I A A A A L A A A A A A A A A I A A A A A A A A A I A L A Z I A A A M A M A A M A A Z A L A A A A A A A A A I A A A L A A Z A A I A I Z A H A A A A A I A A A A A A M A A A A A A M A A A I A Z A M A A A A A A Z A A A M A A A A A L A A A A I I I A L L A A A M A A A M A A A Z A Z A A A A A M A A ...
result:
wrong answer 1st lines differ - expected: 'Z', found: 'A'