QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#573463 | #9320. Find the Easiest Problem | 2023_ljd# | WA | 429ms | 3928kb | C++14 | 896b | 2024-09-18 18:53:04 | 2024-09-18 18:53:34 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std ;
map<char , set<string>> mem ;
vector<pair<char,int>> rec ;
bool cmp(const pair<int,int> &a , const pair<int,int> &b) {
if(a.second != b.second)
return a.second > b.second ;
return a.first < b.first ;
}
void solve() {
int n ; cin >> n ;
for(int i=1 ; i<=n ; i++) {
string teamid , status ; char proid ;
cin >> teamid >> proid >> status ;
if(status == "accepted") {
mem[proid].insert(teamid) ;
}
}
for(auto x : mem)
rec.push_back({x.first , x.second.size()}) ;
sort(rec.begin() , rec.end() , cmp) ;
cout << rec.front().first << endl ;
}
signed main() {
ios::sync_with_stdio(false) ;
cin.tie(nullptr) , cout.tie(nullptr) ;
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: 0ms
memory: 3852kb
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: 429ms
memory: 3928kb
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 H H H Z H H H H H H H H H J F F D D D D D 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 2nd lines differ - expected: 'E', found: 'P'