QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#578196 | #9320. Find the Easiest Problem | fy | Compile Error | / | / | C++14 | 703b | 2024-09-20 17:15:54 | 2024-09-20 17:15:55 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
void solve()
{
int n;cin>>n;
while(n --)
{
int cnt[26] = {0};
set<string> S[26];
string a, b, c;
cin>>a>>b>>c;
if(c[0] == 'r')continue;
if(!S[b[0] - 'A'].count(a))cnt[b[0] - 'A'] ++;
S[b[0] - 'A'].insert(a);
}
int id, mx = 0;
for(int i = 0; i < 26; i ++)
{
if(cnt[i] > mx)
{
mx = cnt[i];
id = i;
}
}
char ans = 'A' + id;
cout<<ans<<endl;
}
int main()
{
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int t;cin>>t;
while(t --)
solve();
return 0;
}
详细
answer.code: In function ‘void solve()’: answer.code:21:12: error: ‘cnt’ was not declared in this scope; did you mean ‘int’? 21 | if(cnt[i] > mx) | ^~~ | int