QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#570153#9320. Find the Easiest ProblemviliantTL 1ms3540kbC++14996b2024-09-17 14:20:012024-09-17 14:20:02

Judging History

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

  • [2024-09-17 14:20:02]
  • 评测
  • 测评结果:TL
  • 用时:1ms
  • 内存:3540kb
  • [2024-09-17 14:20:01]
  • 提交

answer

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

int main() {
	int t,n,i;
	cin >> t;
	cin >> n;
	set<pair<string,char>> s;//利用set存储"acccept"的队名和题目,可自动去重 
	vector<int> count(26,0);
	multiset<char> pro;//利用set存储各队ac题号,可自动排序 
	while(t--){
		for(i = 0;i < n;i++){
			string team,result; char problem;
			cin >> team >> problem >> result;
			if(result == "accepted"){
			s.insert(make_pair(team,problem));
			};
		};
		
	
	vector<pair<string,char>> v(s.begin(),s.end());//从set copy到vector中进行下标索引 
	for(i = 0;i < v.size();i++){
		char problem = v[i].second;
		pro.insert(problem);
	}; 
	
	vector<char> p(pro.begin(),pro.end()); //
	for(i = 0;i < p.size();i++){
			count[p[i] - 'A']++;
	};
	
	int m = 0;
	for(i = 0;i < count.size();i++){
		m = max(count[i],m);
	}
	for(i = 0;i < count.size();i++){
		if(count[i] == m){
			cout << (char)(i + 'A') << endl;
			break;
		}
	}
}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3540kb

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
Time Limit Exceeded

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
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
Z
Z
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
...

result: