QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#576596#9320. Find the Easiest ProblemlxpyydsWA 0ms3620kbC++141014b2024-09-19 21:11:192024-09-19 21:11:20

Judging History

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

  • [2024-09-19 21:11:20]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3620kb
  • [2024-09-19 21:11:19]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        vector<string> dp[26];
        map<char, int> mymap;
        
        for (char j = 'A'; j <= 'Z'; j++) {
            mymap[j] = 0;
        }
        
        for (int i = 0; i < n; i++) {
            string a, c;
            char b;
            cin >> a >> b >> c;
            if (c == "accepted") {
                if (find(dp[b - 'A'].begin(), dp[b - 'A'].end(), a) == dp[b - 'A'].end()) {
                    mymap[b]++;
                    dp[b - 'A'].push_back(a);
                }
            }
        }
        
        char minChar = 'A';
        int minCount = INT_MAX;
        
        for (char i = 'A'; i <= 'Z'; i++) {
            if (mymap[i] < minCount) {
                minCount = mymap[i];
                minChar = i;
            }
        }
        
        cout << minChar << endl;
    }
    return 0;
}

詳細信息

Test #1:

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

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:

D
C

result:

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