QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#578670#9320. Find the Easiest Problemjk231528TL 3ms42660kbC++14709b2024-09-20 20:45:072024-09-20 20:45:08

Judging History

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

  • [2024-09-20 20:45:08]
  • 评测
  • 测评结果:TL
  • 用时:3ms
  • 内存:42660kb
  • [2024-09-20 20:45:07]
  • 提交

answer

#include<iostream>
#include<set>
#include<cstring>
#define sc scanf
using namespace std;
const int N=2e5+8;
int a[50][N];
int ans[50];
int main()
{
	cin.tie(0)->sync_with_stdio(false);
	int t;cin>>t;
	while(t--)
	{
		int n;cin>>n;
		int res,maxx=0;
		memset(ans,0,sizeof(ans));
		memset(a,0,sizeof(a));
		for(int i=1;i<=n;i++ )
		{
			string  s;cin>>s;
			int num=s[4]-'A'+1;
			char x;cin>>x;
			cin>>s;
			if(s[0]=='r')
				continue;
			else
			{
				int t=x-'A'+1;
				if(!a[t][num])
				{
					ans[t]++;
					a[t][num]++;
					if(maxx<ans[t])
						maxx=ans[t],res=t;
				}
				else
					continue;
			}
		}
		res=res+'A'-1;
		printf("%c\n",res);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 42660kb

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:


result: