QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#629435 | #7879. Colorful Balloons | ciyekua | WA | 17ms | 3800kb | C++23 | 307b | 2024-10-11 11:37:22 | 2024-10-11 11:37:23 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
map<string,int> mp;
string s1;
cin>>n;
for(int i=0;i<n;i++) {
cin>>s1;
mp[s1]++;
}
if(mp.rbegin()->second*2>n) cout<<mp.rbegin()->first<<"\n";
else cout<<"uh-oh\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3600kb
input:
5 red green red red blue
output:
red
result:
ok "red"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
3 red blue yellow
output:
uh-oh
result:
ok "uh-oh"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
1 abc
output:
abc
result:
ok "abc"
Test #4:
score: -100
Wrong Answer
time: 17ms
memory: 3760kb
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:
uh-oh
result:
wrong answer 1st words differ - expected: 'vagsmrnnry', found: 'uh-oh'