QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#272763 | #7879. Colorful Balloons | ucup-team266# | WA | 1ms | 3504kb | C++14 | 273b | 2023-12-02 19:06:39 | 2023-12-02 19:06:39 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n;
map<string,int>c;
int main(){
scanf("%d",&n);
string an;
for(int i=1;i<=n;i++){
string s;getline(cin,s);c[s]++;
if(c[s]*2>n){an=s;break;}
}
if(an.empty())puts("uh-oh");
else cout<<an;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3504kb
input:
5 red green red red blue
output:
red
result:
ok "red"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
3 red blue yellow
output:
uh-oh
result:
ok "uh-oh"
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3436kb
input:
1 abc
output:
uh-oh
result:
wrong answer 1st words differ - expected: 'abc', found: 'uh-oh'