QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#568522#9320. Find the Easiest ProblemJordanWA 17ms3600kbC++20958b2024-09-16 16:52:132024-09-16 16:52:14

Judging History

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

  • [2024-09-16 16:52:14]
  • 评测
  • 测评结果:WA
  • 用时:17ms
  • 内存:3600kb
  • [2024-09-16 16:52:13]
  • 提交

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<<mp2.begin()->fs<<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: 100
Accepted
time: 1ms
memory: 3600kb

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: 17ms
memory: 3588kb

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:

A
C
A
A
A
B
A
A
A
A
D
A
F
B
A
C
A
A
A
A
A
A
A
A
A
A
A
B
A
A
A
A
B
B
B
G
B
A
A
A
C
D
A
C
D
A
A
A
A
C
J
A
A
A
A
A
A
B
B
A
A
A
A
A
B
A
C
A
A
G
C
A
E
A
A
A
E
A
B
B
A
B
A
B
A
A
F
B
A
C
C
C
C
A
A
F
A
A
A
A
B
A
B
A
A
A
A
A
A
B
B
A
B
B
A
A
A
A
B
B
A
A
A
B
A
A
B
A
G
B
A
A
G
B
A
A
A
A
B
A
A
A
B
A
A
F
B
A
B
H
...

result:

wrong answer 1st lines differ - expected: 'Z', found: 'A'