QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#637169 | #7879. Colorful Balloons | foolnine# | WA | 0ms | 3848kb | C++20 | 500b | 2024-10-13 10:34:02 | 2024-10-13 10:34:02 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
map<string, int> mp;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
mp[s]++;
}
string ans = "uh-on";
for (auto [x, y] : mp) {
if (2 * y > n) {
ans = x;
break;
}
}
cout << ans << endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3564kb
input:
5 red green red red blue
output:
red
result:
ok "red"
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3848kb
input:
3 red blue yellow
output:
uh-on
result:
wrong answer 1st words differ - expected: 'uh-oh', found: 'uh-on'