QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#572771#9320. Find the Easiest ProblemzhangmengyueWA 16ms7564kbC++14853b2024-09-18 16:19:282024-09-18 16:19:28

Judging History

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

  • [2024-09-18 16:19:28]
  • 评测
  • 测评结果:WA
  • 用时:16ms
  • 内存:7564kb
  • [2024-09-18 16:19:28]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N = 1e3;
int f[N][N];
int ans[N];
int main(){
	int q;
	cin >> q;
	memset(f,-1,sizeof f);
	while(q--){
		int n;
		cin >> n;
		for(int i = 1; i <= n; i++)
		{
			string team;char promble;string res;
			cin >> team >> promble >> res;
			char t4 = team[4];
			if( t4 >='a' && t4 <='z')
				t4 = t4 - 'a' + 'A';
			int t = t4- 'A';
			char p1 = promble;
			if( p1 >='a' && p1 <='z')
				p1 = p1 - 'a' + 'A';
			int p = p1 - 'A';
			int r;
			if(res.compare("accepted") == 0)
				r = 1;
			else
				r = 0;
			if(f[t][p] == -1 && r == 1)
				ans[p] ++;
			f[t][p] = r;
		}
		int max = -1e5;
		int base = -1;
		for(int i = 0; i < 32; i ++ ){
			if(ans[i] > max)
			{
				max = ans[i];
				base = i;
			}
		}
		cout << (char)(base + 'A') << endl;
	}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 7564kb

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

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:

J
J
J
J
J
J
J
F
F
F
F
F
F
F
F
F
F
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
...

result:

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