QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#565861#9320. Find the Easiest ProblemQC_fruitWA 0ms22376kbC++141.3kb2024-09-15 22:26:192024-09-15 22:26:20

Judging History

This is the latest submission verdict.

  • [2024-09-15 22:26:20]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 22376kb
  • [2024-09-15 22:26:19]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2e5 + 7, mod = 1e9 + 7;
const int inf = 1LL << 30;

int n;
struct Node {
    string te;
    string c;
    bool operator<(const Node other) const {
        if (te != other.te) return te < other.te;
        return c < other.c;
    }
};
int ans[30];
string s[N];
string c[N];
string as[N];
map<Node, int> mp;
void solve() {
    int t;
    cin >> t;
    while (t--) {
        cin >> n;
        mp.clear();
        for(int i=0;i<=26;++i) ans[i] = 0;
        for (int i = 1; i <= n; ++i) {
            cin >> s[i] >> c[i] >> as[i];
        }
        for (int i = n; i >= 1; --i) {
            if (mp[Node{s[i], c[i]}] == 0) {
                if (as[i] == "accepted") {
                    ans[c[i][0] - 'A']++;
                    mp[Node{s[i], c[i]}] = 1;
                } else {
                    
                }
            }
        }
        char tc;
        int mx = 0;
        for (int i = 0; i < 26; ++i) {
//            cout<<ans[i]<<endl;
            if (mx < ans[i]) {
                tc = i + 'A';
                mx = ans[i];
            }
        }
        cout << tc;
        if(t!=1) cout << endl;
    }
}
signed main() {
    solve();

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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:

AA

result:

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