QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#570289#9320. Find the Easiest ProblemjpphyWA 4ms3784kbC++17844b2024-09-17 15:10:182024-09-17 15:10:22

Judging History

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

  • [2024-09-17 15:10:22]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:3784kb
  • [2024-09-17 15:10:18]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n, c[26], id[30];
char s[20], p[2], r[30];
void solve(){
    map<string, int> mp;
    set<int> ts[26];
    int tmp;
    while(n--){
        scanf("%s%s%s", s, p, r);
        p[0] -= 'A';
        if(r[0] == 'r') continue;
        if(mp.count(s) == 0) mp[s] = mp.size();
        tmp = mp[s];
        if(ts[p[0]].find(tmp) != ts[p[0]].end()){
            c[p[0]]++;
            ts[p[0]].insert(tmp);
        }
    }
    sort(id, id+27, [](int x, int y){
        if(c[x] == c[y]) return x < y;
        return c[x] > c[y];
    });
    printf("%c\n", id[0]+'A');
}
signed main(){
    for(int i = 0; i < 26; ++i) id[i] = i;
    int t;
    scanf("%d", &t);
    while(t--){
        memset(c, 0, sizeof c);
        scanf("%d", &n);
        solve();
    }
    return 0;
}

详细

Test #1:

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

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: 4ms
memory: 3736kb

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'