QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#273070 | #7879. Colorful Balloons | ucup-team484# | WA | 5ms | 3852kb | C++17 | 525b | 2023-12-02 21:05:33 | 2023-12-02 21:05:34 |
Judging History
answer
#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define st first
#define nd second
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const int N = 1e6 + 5;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
map<string, int> cnt;
int n; cin >> n;
for (int i = 0; i < n; i++) {
string s; cin >> s;
cnt[s]++;
}
for (auto [s, c]: cnt) {
if (2 * c >= n) {
cout << s << "\n";
return 0;
}
}
cout << "uh-oh\n";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3844kb
input:
5 red green red red blue
output:
red
result:
ok "red"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
3 red blue yellow
output:
uh-oh
result:
ok "uh-oh"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
1 abc
output:
abc
result:
ok "abc"
Test #4:
score: 0
Accepted
time: 2ms
memory: 3564kb
input:
100000 vagsmrnnry vagsmrnnry bvaojtyvmn vagsmrnnry vagsmrnnry vvzrbrqrgb vagsmrnnry vvzrbrqrgb vagsmrnnry vagsmrnnry bvaojtyvmn vagsmrnnry vagsmrnnry vvzrbrqrgb vagsmrnnry bvaojtyvmn vagsmrnnry vagsmrnnry vagsmrnnry vvzrbrqrgb vagsmrnnry vvzrbrqrgb vagsmrnnry vagsmrnnry vagsmrnnry vagsmrnnry vagsmrn...
output:
vagsmrnnry
result:
ok "vagsmrnnry"
Test #5:
score: -100
Wrong Answer
time: 5ms
memory: 3852kb
input:
100000 khccohwxsc aakazkvryg khccohwxsc aakazkvryg khccohwxsc khccohwxsc aakazkvryg aakazkvryg khccohwxsc djckwpxwyt khccohwxsc khccohwxsc djckwpxwyt khccohwxsc aakazkvryg djckwpxwyt djckwpxwyt djckwpxwyt aakazkvryg djckwpxwyt aakazkvryg aakazkvryg khccohwxsc aakazkvryg khccohwxsc aakazkvryg aakazkv...
output:
aakazkvryg
result:
wrong answer 1st words differ - expected: 'uh-oh', found: 'aakazkvryg'