QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#568140#9320. Find the Easiest ProblemClauvenater_#RE 0ms3588kbC++20935b2024-09-16 15:21:342024-09-16 15:21:36

Judging History

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

  • [2024-09-16 15:21:36]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3588kb
  • [2024-09-16 15:21:34]
  • 提交

answer

#include <iostream>
#include <vector>
//#include <windef.h>
#include <algorithm>
#include <cstdlib>
#include <cassert>
#include <numeric>
#include <climits>
#include <set>
#include <map>
#define ENDL endl
using i64=long long;
std::istream& CIN = std::cin;
std::ostream& COUT = std::cout;
using namespace std;

int main() {
    int tt;
    cin>>tt;
    while(tt--){
        int n;
        cin>>n;

        map<string,set<string>> smi;
        for(int i = 0;i<n;i++){
            string team,problem,status;
            CIN>>team>>problem>>status;
            if(status == "accepted"){
                smi[problem].insert(string(team.begin() + 4,team.end()));
            }
        }
        pair<int,string> ans;
        for(const auto& m:smi){
            int x = m.second.size();
            if(x > ans.first){
                ans = make_pair(x,m.first);
            }
        }
        cout<<ans.second<<endl;

    }
    return 0;
}

詳細信息

Test #1:

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

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
Runtime Error

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:

Z

result: