QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#572957 | #9320. Find the Easiest Problem | zhangmengyue | RE | 2ms | 7764kb | C++14 | 1.2kb | 2024-09-18 16:55:51 | 2024-09-18 16:55:52 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 1e3;
int f[N][N];
int ans[N];
int main(){
int q;
cin >> q;
memset(f,-1,sizeof f);
while(q--){
int n;
cin >> n;
memset(ans,0,sizeof ans);
for(int i = 1; i <= n; i++)
{
string team;char promble;string res;
cin >> team >> promble >> res;
int t = 0;
// cout << team.size() << endl;
for(int i = 4; i < team.size(); i ++){
char e = team[i];
if( e >='a' && e <='z')
e = e - 'a' + 'A';
else
e = e - 'A';
t = t *10 + team[i] - 'A';
}
int p = promble - 'A';
int r;
if(res.compare("accepted") == 0)
r = 1;
else
r = 0;
// cout << t << " " << p << " " << r << endl;
if(f[t][p] == -1 && r == 1)
{
ans[p] ++;
f[t][p] = r;
}
// cout << ans[p] << endl;
}
int max = -1e5;
int base = -1;
for(int i = 0; i < 32; i ++ ){
// cout << ans[i] <<" ";
if(ans[i] > max)
{
max = ans[i];
base = i;
}
}
// for(int i = 0; i < 32; i ++){
// for(int j = 0; j < 32; j ++){
// cout << f[i][j] << " ";
// }
// cout << endl;
// }
cout << (char)(base + 'A') << endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 7764kb
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
Runtime Error
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...