QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#567464 | #9320. Find the Easiest Problem | Darkmaster | WA | 14ms | 7528kb | C++14 | 909b | 2024-09-16 12:08:40 | 2024-09-16 12:08:40 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, flag[100], cnt[100];
struct Node{
string x;
char y;
}a[N];
bool cmp(Node a, Node b){
return a.x < b.x;
}
void solve(){
char ans;
int maxx = 0;
cin >> n;
for(int i = 1; i <= n; i ++){
string c;
cin >> a[i].x >> a[i].y >> c;
if(c[0] == 'r') continue;
}
sort(a + 1, a + n + 1, cmp);
for(int i = 'A'; i <= 'Z'; i ++) flag[i] = 0, cnt[i] = 0;
flag[a[1].y] = 1, cnt[a[1].y] = 1;
for(int i = 2; i <= n; i ++){
if(a[i].x != a[i - 1].x){
for(int j = 'A'; j <= 'Z'; j ++) flag[j] = 0;
}
if(!flag[a[i].y]) cnt[a[i].y]++;
flag[a[i].y] = 1;
}
for(int i = 'A'; i <= 'Z'; i ++)
if(cnt[i] > maxx) maxx = cnt[i], ans = i;
cout << ans << '\n';
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T;
cin >> T;
while(T--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 7472kb
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: 14ms
memory: 7528kb
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:
P E C H A I N F E K H I F B X L R O A H J F I H A A A Q V T K A F A H G L E S D G D Q Y J V H C C O J V T B U E I T C O V H Z I G O N F O G I B E A D J L A K B J S U V Z A K A S P D H G J H W I I E G H A F L D V E S B R H K Q G P C W B F T I F E K P U Q R N V O N N G L H A J E U J R Y K F F T F B H ...
result:
wrong answer 1st lines differ - expected: 'Z', found: 'P'