QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#568544#9320. Find the Easiest ProblemJordanWA 0ms3616kbC++20969b2024-09-16 16:57:072024-09-16 16:57:08

Judging History

你现在查看的是最新测评结果

  • [2024-09-16 16:57:08]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3616kb
  • [2024-09-16 16:57:07]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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: ''