QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#569895#9320. Find the Easiest Problemyuk11119WA 15ms3656kbC++17692b2024-09-17 11:56:492024-09-17 11:56:51

Judging History

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

  • [2024-09-17 11:56:51]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:3656kb
  • [2024-09-17 11:56:49]
  • 提交

answer

#include <iostream>
#include <cstring>
#include <algorithm>
#include <map>

using namespace std;

int n, T, cnt[27];
map<pair<int, int>, bool> mp;
string s;


int main()
{
	cin >> T;
	while(T--)
	{
		memset(cnt, 0, sizeof(cnt));
		mp.clear();
		
		cin >> n;
		getchar();
		for(int i = 0; i < n; i++)
		{
			getline(cin, s);
			if(s[8] == 'r') continue;
			else if(mp[{s[6] - 'A', s[4] - 'A'}] == false)
			{
				cnt[s[6] - 'A']++;
				mp[{s[6] - 'A', s[4] - 'A'}] = true;
			}
		}
		
		int ans = 0, idx;
		for(int i = 0; i < 26; i++)
		{
			if(cnt[i] > ans)
			{
				ans = cnt[i];
				idx = i;
			}
		}
		
		cout << (char)(idx + 'A') << endl;
	}
}

詳細信息

Test #1:

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

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: 15ms
memory: 3624kb

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
I
A
A
A
A
L
A
A
A
A
A
A
A
A
A
I
A
A
A
A
A
A
A
A
A
I
A
L
A
Z
I
A
A
A
M
A
M
A
A
M
A
A
Z
A
L
A
A
A
A
A
A
A
A
A
I
A
A
A
L
A
A
Z
A
A
I
A
I
Z
A
H
A
A
A
A
A
I
A
A
A
A
A
A
M
A
A
A
A
A
A
M
A
A
A
I
A
Z
A
M
A
A
A
A
A
A
Z
A
A
A
M
A
A
A
A
A
L
A
A
A
A
I
I
I
A
L
L
A
A
A
M
A
A
A
M
A
A
A
Z
A
Z
A
A
A
A
A
M
A
A
...

result:

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