QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#571062#9320. Find the Easiest ProblemYainWA 1ms3648kbC++141.6kb2024-09-17 20:16:432024-09-17 20:16:44

Judging History

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

  • [2024-09-17 20:16:44]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3648kb
  • [2024-09-17 20:16:43]
  • 提交

answer

#include<bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define gcd __gcd
#define int LL
//#define pow quickPow
#pragma GCC optimize(2)
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
bool cmp(int a, int b){return a > b;}
int lcm(int a, int b){return a / gcd(a, b) * b;}


const int mod = 998244353;
const int MOD = 1e9 + 7;
const int inf = 2147483647;
const int N = 2e5 + 10, M = 30;

int quickPow(int a,int b){
    int ans=1;
    while(b){
        if(b&1)
            ans=(ans*a)%mod;
        b>>=1;
        a=(a*a)%mod;
    }
    return ans;
}

/*void init(){
    //求阶乘
    fac[0]=1;
    for(int i=1;i<maxn;i++){
        fac[i]=fac[i-1]*i%mod;
    }
    //求逆元
    inv[maxn-1]=quickPow(fac[maxn-1],mod-2);
    for(int i=maxn-2;i>=0;i--){
        inv[i]=inv[i+1]*(i+1)%mod;
    }
}
int C(int n,int m){
    if(m>n){
        return 0;
    }
    if(m==0)
        return 1;
    return fac[n]*inv[m]%mod*inv[n-m]%mod;
}*/

/*int find(int x)
{
    if(fa[x]!=x) fa[x]=find(fa[x]);
    return fa[x];
}*/


void solve()
{
	map<string, int> mp;
	vector<string> a;
	int n;
	cin >> n;
	for(int i = 1; i <= n; ++ i)
	{
		string s1, s2, s3;
		cin >> s1 >> s2 >> s3;
		if(s3 == "accepted") mp[s2] ++;
		a.push_back(s2);
	}
	sort(a.begin(), a.end());
	string ans = a[0];
	for(int i = 0; i < a.size(); ++ i)
	{
		if(mp[a[i]] > mp[ans]) ans = a[i];
	}
	cout << ans << endl;
}

signed main()
{
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	int t = 1;
	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: 1ms
memory: 3648kb

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
B

result:

wrong answer 2nd lines differ - expected: 'A', found: 'B'