QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#571144#9320. Find the Easiest Problemlwl123Compile Error//C++14684b2024-09-17 20:45:392024-09-17 20:45:40

Judging History

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

  • [2024-09-17 20:45:40]
  • 评测
  • [2024-09-17 20:45:39]
  • 提交

answer

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

void solve() {
	int n;
	cin >> n;
	vector<vector<string>> a(26);
	for(int i = 0; i < n; i ++ ) {
		string name, result;
		char id;
		cin >> name >> id >> res;
		if(res == "accepted") {
			a[id - 'A'].push_back(name);
		}
	}
	
	int ans, mx = 0;
	for(int i = 0; i < 26; i ++ ) {
		sort(a[i].begin(), a[i].end());
		a[i].erase(unique(a[i].begin(), a[i].end()), a[i].end());
		
		if(a[i].size() > mx) {
			mx = a[i].size();
			ans = i;
		}
	}
	
	cout << char(ans + 'A') << endl;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int t;
	cin >> t;
	while(t -- ) {
		solve();
	}
	return 0;
}

Details

answer.code: In function ‘void solve()’:
answer.code:11:38: error: ‘res’ was not declared in this scope
   11 |                 cin >> name >> id >> res;
      |                                      ^~~