QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#570301#9320. Find the Easiest ProblemxxfeiWA 17ms3588kbC++201.0kb2024-09-17 15:14:572024-09-17 15:15:01

Judging History

This is the latest submission verdict.

  • [2024-09-17 15:15:01]
  • Judged
  • Verdict: WA
  • Time: 17ms
  • Memory: 3588kb
  • [2024-09-17 15:14:57]
  • Submitted

answer

#include <iostream>
#include <map>
#include <vector>
using namespace std;

struct question {
    map<string, bool> team; 
    int sum = 0;
};

int main() {
    int t;
    cin >> t;

    while (t--) {
        int n;
        cin >> n;

        string team_name, answer;
        char question_char;
        vector<question> qt(26); // 26个字母对应的问题

        for (int i = 0; i < n; ++i) {
            cin >> team_name >> question_char >> answer;

            if (answer == "accepted") {
                int k = question_char - 'A';

                if (qt[k].team.find(team_name) == qt[k].team.end()) {
                    qt[k].team[team_name] = true; 
                }
            }
        }

        int max_sum = 0;
        char result = 'A';
        for (int i = 0; i < 26; ++i) {
            if (qt[i].sum > max_sum) {
                max_sum = qt[i].sum;
                result = i + 'A';
            }
        }

        cout << result << endl;
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 17ms
memory: 3588kb

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'