QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#570153 | #9320. Find the Easiest Problem | viliant | TL | 1ms | 3540kb | C++14 | 996b | 2024-09-17 14:20:01 | 2024-09-17 14:20:02 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
int t,n,i;
cin >> t;
cin >> n;
set<pair<string,char>> s;//利用set存储"acccept"的队名和题目,可自动去重
vector<int> count(26,0);
multiset<char> pro;//利用set存储各队ac题号,可自动排序
while(t--){
for(i = 0;i < n;i++){
string team,result; char problem;
cin >> team >> problem >> result;
if(result == "accepted"){
s.insert(make_pair(team,problem));
};
};
vector<pair<string,char>> v(s.begin(),s.end());//从set copy到vector中进行下标索引
for(i = 0;i < v.size();i++){
char problem = v[i].second;
pro.insert(problem);
};
vector<char> p(pro.begin(),pro.end()); //
for(i = 0;i < p.size();i++){
count[p[i] - 'A']++;
};
int m = 0;
for(i = 0;i < count.size();i++){
m = max(count[i],m);
}
for(i = 0;i < count.size();i++){
if(count[i] == m){
cout << (char)(i + 'A') << endl;
break;
}
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3540kb
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
Time Limit Exceeded
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:
Z P P P P P P P P P P P P P P P P P P Z Z H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H ...