QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#579478 | #9320. Find the Easiest Problem | Christins | Compile Error | / | / | C++14 | 965b | 2024-09-21 14:07:11 | 2024-09-21 14:07:12 |
Judging History
answer
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
void solve() {
int n;
std::cin >> n;
std::unordered_set<std::string> vis[26];
for (int i = 0; i < n; i++) {
char ID;
std::string team, status;
std::cin >> team >> ID >> status;
if (!vis[ID - 'A'].count(team) && status == "accepted") {
vis[ID - 'A'].insert(team);
}
}
int max = 0;
for (int i = 0; i < 26; i++) {
max = std::max(max, static_cast<int>2(vis[i].size()));
}
int ans = 0;
for (int i = 0; i < 26; i++) {
if (vis[i].size() == max) {
ans = std::min(ans, i);
}
}
std::cout << char(ans + 'A') << "\n";
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
solve();
}
return 0;
}
詳細信息
answer.code: In function ‘void solve()’: answer.code:23:45: error: expected ‘(’ before numeric constant 23 | max = std::max(max, static_cast<int>2(vis[i].size())); | ^ | ( answer.code:23:46: error: expression cannot be used as a function 23 | max = std::max(max, static_cast<int>2(vis[i].size())); | ~^~~~~~~~~~~~~~~