QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#568001#9320. Find the Easiest ProblemposeWA 30ms3656kbC++23841b2024-09-16 14:54:502024-09-16 14:54:53

Judging History

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

  • [2024-09-16 14:54:53]
  • 评测
  • 测评结果:WA
  • 用时:30ms
  • 内存:3656kb
  • [2024-09-16 14:54:50]
  • 提交

answer

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

int a[2000005];
int b[2000005];
int c[2000005];

string s[1005];
 

void sl()
{
	int n;
	cin >> n;
	string ans;
	int ans1=0;
	map<pair<string,string>,int>mp;
	map<string,int>mp1;
	map<string,int>mp2;
	for(int i=0;i<n;i++)
	{
		string s1="",s2="",s3="";
		cin >> s1 >> s2 >> s3;		
			if(s3=="accepted")
			{
				mp[{s1,s2}]++;
				if(mp[{s1,s2}]==1)mp1[s2]++;
			}	
			mp2[s2]++;

	}
	for(char i='A';i<='Z';i++)
	{
		string ss="";
		ss+=i;
		if(mp1[ss]>ans1)ans=ss,ans1=mp1[ss];
		if(mp1[ss]==ans1)
		{
			if(mp1[ss]*1.0/mp2[ss]>mp1[ans]*1.0/mp2[ans])
			{
				ans=ss;
			}
		}
	}
	cout << ans << '\n';	
}

signed main()
{
	int t=1;
	cin >> t;
	while(t--)
	{
		sl();
	}
}


 /*
9
ejibmyyju
*/
 
 


 
 
 

Details

Tip: Click on the bar to expand more detailed information

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

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
E
Z
I
B
I
G
H
T
T
K
I
H
R
Z
C
K
O
I
P
A
E
I
A
A
N
S
E
A
O
W
O
Z
T
H
G
Z
E
S
U
F
M
R
C
U
V
W
P
A
O
K
E
A
U
U
M
C
T
L
G
X
A
Z
N
E
V
Q
R
B
G
J
I
O
O
A
Z
E
A
K
J
J
S
E
W
Z
K
F
W
S
P
M
Q
G
G
H
Y
I
P
T
J
O
A
X
N
C
S
Y
Z
Z
G
W
F
Q
F
O
C
F
F
U
L
O
A
E
I
P
Y
I
R
X
N
D
N
O
Q
L
M
X
R
H
U
J
Z
D
K
G
F
T
N
B
R
...

result:

wrong answer 9th lines differ - expected: 'S', found: 'T'