QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#565280 | #9320. Find the Easiest Problem | bigJ | RE | 0ms | 3676kb | C++23 | 1.1kb | 2024-09-15 20:49:33 | 2024-09-15 20:49:33 |
Judging History
answer
#include <bits/stdc++.h>
namespace stdv = std::views;
namespace stdr = std::ranges;
using i64 = long long;
template<typename A, typename B>
constexpr bool chmax(A& a, const B& b) {
a = (a > b) ? a : b;
return a == b;
}
template<typename A, typename B>
constexpr bool chmin(A& a, const B& b) {
a = (a < b) ? a : b;
return a == b;
}
void Find() {
int n;
std::cin >> n;
int cnt[26]{};
std::map<std::string, std::array<bool, 26>> vis;
for (int i = 0; i < n; i++) {
std::string name;
char c;
std::string res;
std::cin >> name >> c >> res;
if (res != "accepted") {
continue;
}
name = name.substr(4);
c -= 'A';
if (!vis[name][c]) {
vis[name][c] = true;
cnt[c]++;
}
}
std::cout << char(stdr::max_element(cnt) - cnt + 'A') << "\n";
}
int main(int argc, const char* argv[]) {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
Find();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3676kb
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
Runtime Error
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...