QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#567433#9320. Find the Easiest ProblemfutarianWA 7ms3700kbC++14903b2024-09-16 11:55:112024-09-16 11:55:11

Judging History

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

  • [2024-09-16 11:55:11]
  • 评测
  • 测评结果:WA
  • 用时:7ms
  • 内存:3700kb
  • [2024-09-16 11:55:11]
  • 提交

answer

#include "bits/stdc++.h"
using namespace std;
#define ui unsigned int 
const int base = 131 , mod = 998244353;
int sum[28],n,m;
map<ui,int> mp[28];ui ret = 0;
char s[100005];
signed main()
{
	int T;scanf("%d",&T);
	while(T --)
	{
		for(int i = 0 ; i < 26 ; i ++) 
		{
			mp[i].clear();
			sum[i] = 0;
		}
		scanf("%d",&n);
		for(int i = 1 ; i <= n ; i ++)
		{
			scanf("%s",s + 1);
			m = strlen(s + 1);ret = 0;
			for(int j = 1 ; j <= m ; j ++) ret = 1ll * ret * base + (s[j] - 'a');
			char nb;
			cin >> nb;scanf("%s",s + 1);
			if(s[0] == 'R') continue;
			if(mp[nb - 'A'][ret]) continue;
			mp[nb - 'A'][ret] = 1;
			sum[nb - 'A'] ++;
		}
		int maxn = 0;
		for(int i = 0 ; i < 26 ; i ++) maxn = max(maxn , sum[i]);
		for(int i = 0 ; i < 26 ; i ++) 
		{
			if(sum[i] == maxn)
			{
				cout << char(i + 'A') << endl;
				break;
			}
		}
		
	}
	return 0;
}

詳細信息

Test #1:

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

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

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:

P
E
C
H
A
I
N
F
E
K
H
I
F
B
X
L
R
O
A
H
J
F
I
H
A
A
A
Q
V
T
K
A
F
A
H
G
L
E
S
D
G
D
Q
Y
J
V
H
C
C
O
J
V
T
B
U
E
I
T
C
O
V
H
Z
I
G
O
N
F
O
G
I
B
E
A
D
J
L
A
K
B
J
S
U
V
Z
A
K
A
S
P
D
H
G
J
H
W
I
I
E
G
H
A
F
L
D
V
E
S
B
R
H
K
Q
G
P
C
W
B
F
T
I
F
E
K
P
U
Q
R
N
V
O
N
N
G
L
H
A
J
E
U
J
R
Y
K
F
F
T
F
B
H
...

result:

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