QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#565340#9320. Find the Easiest ProblemfruianWA 6ms3940kbC++201.5kb2024-09-15 21:00:372024-09-15 21:00:40

Judging History

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

  • [2024-09-15 21:00:40]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:3940kb
  • [2024-09-15 21:00:37]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
#define all(x) (x).begin(), (x).end()
#define x first
#define y second
#define endl "\n" 
#define int long long
#define sz(x) ((int)(x).size())
#define lowbit(x) ((x) & -(x))
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i,x,y) for(int i = x;i<y;i++)
#define reb(i,x,y) for(int i = x;i<=y;i++)
typedef long long ll;
typedef pair<int, int> pii;
typedef double db;
typedef long double ld;
const int N = 1e3+10, M = 1e4 + 20, mod = 1e9+7 , inf = 0x7fffffff;;
const ld eps = 1e-12;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}


inline void solve() {
    int n;
    cin>>n;
    map<string,int>team[26];
    vector<int>pb(30);
    while(n--){
        string a,c;
        char b;
        cin>>a>>b>>c;
        if(c=="rejected")continue;
        if(team[b-'A'][a]!=1)continue;
        team[b-'A'][a] = 1;
        pb[b-'A']++;
    }
    int maxx = 0;
    for(int i = 0;i<30;i++){
        maxx = max(maxx, pb[i]);
    }
    for(int i = 0;i<30;i++){
        if(pb[i]==maxx){
            printf("%c\n",i+'A');
            return;
        }
    }
}


signed main(){
    IOS;
    cout << fixed << setprecision(10);
    int __ = 1;
    cin>>__;
    while(__--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3940kb

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: 6ms
memory: 3720kb

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
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
...

result:

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