QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#566986#9320. Find the Easiest ProblemLam017Compile Error//C++20906b2024-09-16 04:38:382024-09-16 04:38:39

Judging History

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

  • [2024-09-16 04:38:39]
  • 评测
  • [2024-09-16 04:38:38]
  • 提交

answer

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int t;
    cin >> t;
    
    while (t--) {
        int n; 
        cin >> n;
        
        map<char, set<string>> solved; 
        for (int i = 0; i < n; i++) {
            string team, problem, result;
            cin >> team >> problem >> result;
            
            if (result == "accepted") {
                solved[problem[0]].insert(team); 
            }
        }
        char ea = 'Z' + 1;
        int maxS = 0;
        
        for (auto& [problem, teams] : solved) {
            int num = teams.size();
            if (num > maxS || 
               (num == maxS && problem < ea)) {
                maxS = numS;
                ea = problem;
            }
        }
        
        cout << ea << endl;
    }
    
    return 0;
}

详细

answer.code: In function ‘int main()’:
answer.code:31:24: error: ‘numS’ was not declared in this scope; did you mean ‘num’?
   31 |                 maxS = numS;
      |                        ^~~~
      |                        num