QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#570546#9320. Find the Easiest ProblemSocialPandaWA 3ms3616kbC++201.2kb2024-09-17 16:26:282024-09-17 16:26:32

Judging History

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

  • [2024-09-17 16:26:32]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3616kb
  • [2024-09-17 16:26:28]
  • 提交

answer

#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
//#define int long long
//#define LL long long
#define double long double
//#define lf Lf
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define endl "\n"
#define PII pair<int,int>
#define Gheap priority_queue<int,vector<int>,greater<int>>
#define Lheap priority_queue<int>
#define MAXN 0x3f3f3f3f
#define MINN -0x3f3f3f3f
using namespace std;
//const int N=1e6+100,M=2*N;
//int e[N],w[M],h[M],ne[M],idx;

unordered_map<string,int> tt,pr;

void solve()
{
    int n;cin>>n;

    for(int i=1;i<=n;i++)
    {
    	string team,id,status;
    	cin>>team>>id>>status;
    	if(status=="accepted")
    	{
    		if(tt[team]==0) pr[id]++;
    		tt[team]++;
    	}
    }

    string ans;
    int num=0;

    for(auto z:pr)
    {
    	if(z.se>num)
    	{
    		num=z.se;
    		ans=z.fi;
    	}
    	else if(z.se==num)
    	{
    		ans=min(ans,z.fi);
    	}
    }

    cout<<ans<<endl;

}

int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int tt=1;
    cin >> tt;
    while(tt--) solve();
}

详细

Test #1:

score: 100
Accepted
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:

ok 2 lines

Test #2:

score: -100
Wrong Answer
time: 3ms
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:

O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
...

result:

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