QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#568544 | #9320. Find the Easiest Problem | Jordan | WA | 0ms | 3616kb | C++20 | 969b | 2024-09-16 16:57:07 | 2024-09-16 16:57:08 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define endl '\n'
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef pair<int, int> PII;
const int N = 2e5+10;
bool cmp(pair<string,int>a,pair<string,int> b)
{
if(a.sc==b.sc)return a.fs<b.fs;
return a.sc>b.sc;
}
void solve()
{
int n;
cin>>n;
map<string,int> mp1;
map<string,int> mp2;
string a,b,c;
for(int i=0;i<n;i++)
{
cin>>a>>b>>c;
if(!mp1[a+b]&&c[0]=='a')
{
mp1[a+b]=1;
mp2[b]++;
}
}
//仿函数拉倒 用vector对map的val排序
vector<pair<string,int>> v(all(mp2));
sort(all(v),cmp);
cout<<v[0].fs<<endl;
cout<<endl;
}
int main()
{
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(0);
int t;
cin >> t;
while (t--)
{
solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3616kb
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:
wrong answer 2nd lines differ - expected: 'A', found: ''