QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#567867#9320. Find the Easiest Problemwangf_916WA 13ms3780kbC++201017b2024-09-16 14:21:282024-09-16 14:21:28

Judging History

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

  • [2024-09-16 14:21:28]
  • 评测
  • 测评结果:WA
  • 用时:13ms
  • 内存:3780kb
  • [2024-09-16 14:21:28]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define PII pair<int,int>
#define pb push_back
#define all(x) (x).begin(), (x).end()

using ll = long long;
using ull = unsigned long long;

struct AAA
{	
	string s1;
	char s2;
	string s3;
};

void solve() {
	int n;
	cin >> n;
	map<pair<string, char>, int> mp;
	map<char, int> mp2;
	int mx = -1;
	char ans = 'A';
	vector<AAA> vec(n);
	for (int i = 0; i < n; i ++) {
		cin >> vec[i].s1 >> vec[i].s2 >> vec[i].s3;
		if(vec[i].s3 == "accepted") {
			pair<string, char> z;
			z.first = vec[i].s1;
			z.second = vec[i].s2; 
			mp[z] ++;
			if(mp[z] == 1) {
				mp2[vec[i].s2] ++;
				if(mp2[vec[i].s2] >= mx) {
					if(mp2[vec[i].s2] == mx) {
						if(vec[i].s2 < ans) {
						ans = vec[i].s2;
					}
				}
				} else {
					ans = vec[i].s2;
				}
			}
		}
	}
	cout << ans << '\n';
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int tt;
	cin >> tt;
	while (tt--) {
		solve();	
	}

	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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

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:

A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
...

result:

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