QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#575499#9320. Find the Easiest ProblemRomanticCompile Error//C++20669b2024-09-19 14:51:082024-09-19 14:51:09

Judging History

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

  • [2024-09-19 14:51:09]
  • 评测
  • [2024-09-19 14:51:08]
  • 提交

answer

#include<bits/stdc++.h>
// #define int long long
using namespace std;
#define fi first
#define se second
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
int n, m, k;

void solve()
{
	cin >> n;
	map<string, set<string>> mp;
	for(int i = 1; i <= n; i ++)
	{
		string a, b, c;
		cin >> a >> b >> c;
		if(c == "accepted") {mp[b].insert(a);}
	}
	int sum = 0;
	string a;
	for(auto p: mp)
	{
		if(p.se.size() > sum)
		{
			sum = p.se;
			a = p.fi;
		}
	}
	cout << a << endl;
}
signed main()
{
	ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int __tt = 1;
    cin >> __tt;
    while(__tt --)  solve();
    return 0;
}

Details

answer.code: In function ‘void solve()’:
answer.code:5:12: error: cannot convert ‘std::set<std::__cxx11::basic_string<char> >’ to ‘int’ in assignment
    5 | #define se second
      |            ^
      |            |
      |            std::set<std::__cxx11::basic_string<char> >
answer.code:26:33: note: in expansion of macro ‘se’
   26 |                         sum = p.se;
      |                                 ^~