QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#565521#9320. Find the Easiest Problemgreen__handWA 0ms3584kbC++201.1kb2024-09-15 21:33:572024-09-15 21:33:58

Judging History

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

  • [2024-09-15 21:33:58]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3584kb
  • [2024-09-15 21:33:57]
  • 提交

answer

#include <bits/stdc++.h>

#define int long long
using namespace std;
typedef long long i64;
typedef pair<int, int> PII;

const int N = 2e5 + 10, p = 998244353;

int lowbit(int x) { return x & (-x); }

int fac26[N];

int qmi(int a, int b, int p) {
    int res = 1;
    while (b) {
        if (b & 1) res = res * a % p;
        a = a * a % p;
        b >>= 1;
    }
    return res;
}


void solve() {
    int n; cin >> n;
    map<string, set<string>> mp;
    map<string, int> t;
    for (int i = 0; i < n; i++) {
        string a, b, c; cin >> a >> b >> c;
        if (c == "accepted") {
            if (!mp[a].count(b)) {
                mp[a].insert(b);
            }
            t[b]++;
        }
    }
    int max = -1e9;
    string ans;
    for (auto it : t) {
        if (max < it.second) {
            max = it.second;
            ans = it.first;
        }
    }
    cout << ans << '\n';
}

signed main() {
    ios::sync_with_stdio(false), cin.tie(nullptr);
    int T = 1;
    cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

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'