QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#567938#9320. Find the Easiest ProblemonewangzaiWA 29ms3524kbC++20564b2024-09-16 14:44:132024-09-16 14:44:13

Judging History

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

  • [2024-09-16 14:44:13]
  • 评测
  • 测评结果:WA
  • 用时:29ms
  • 内存:3524kb
  • [2024-09-16 14:44:13]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

int main(){
	int T;
	cin >> T;
	while(T--)
	{
		map<string,int> mp;
		int n,Max = 0;
		cin >> n;
		string s1,s2,s3,ans;
		for(int i = 1; i <= n; i++)
		{
			cin >> s1 >> s2 >> s3;
			s1 = s1 + s2;
			if(mp[s1] == 0 && s3 == "accepted")
			{
				mp[s1] = 1;
				mp[s2]++;
				if(mp[s2] > Max)
				{
					Max = mp[s2];
					ans = s2;
				}
				else if(mp[s2] == Max && s2[0] < ans[0])
				{
					cout << 1 << endl;
					ans = s2;
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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

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:

1
Z
1
E
1
1
1
1
Z
1
1
1
1
I
B
1
I
1
1
G
1
1
H
1
1
1
1
1
S
1
1
1
1
K
1
1
1
J
I
1
1
1
H
1
R
1
1
1
Z
1
1
C
1
1
1
1
K
1
1
O
1
I
1
1
1
1
1
P
1
A
1
1
1
1
B
1
1
I
1
1
1
A
1
A
1
1
1
1
1
N
A
1
1
1
1
1
B
1
A
1
1
1
O
1
1
F
1
O
1
1
1
R
1
1
1
1
1
T
H
G
1
1
K
1
1
1
E
1
1
1
S
1
1
1
1
1
1
1
D
1
1
1
1
1
F
D
1
1
R
1
...

result:

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