QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#566906#9320. Find the Easiest ProblemKidding_MaRE 0ms0kbC++17876b2024-09-16 03:08:132024-09-16 03:08:13

Judging History

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

  • [2024-09-16 03:08:13]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-09-16 03:08:13]
  • 提交

answer

#include "bits/stdc++.h"

using namespace std;
using i64 = int64_t;
using ll = long long;

void solve() {
    int n;
    cin >> n;
    vector<vector<string>> a;
    for (int i = 0; i < n; i++) {
        string name, res;
        char id;
        cin >> name >> id >> res;
        if (res == "accepted") {
            a[id - 'A'].push_back(name);
        }
    }

    int ans;
    int mx = 0;
    for (int i = 0; i < 26; i++) {
        sort(a[i].begin(), a[i].end());
        a[i].erase(unique(a[i].begin(), a[i].end()), a[i].end());

        if (a[i].size() > mx) {
            mx = a[i].size();
            ans = i;
        }        
    }
    cout << char(ans + 'A') << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;
    while (t--) {
        solve();
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Runtime Error

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:


result: