QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#275861 | #7879. Colorful Balloons | kath# | WA | 1ms | 3420kb | C++14 | 348b | 2023-12-05 10:13:50 | 2023-12-05 10:13:51 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;cin>>n;
map<string,int>mp;
for(int i=0;i<n;i++)
{
string str;
cin>>str;
mp[str]++;
}
for(auto[str,cnt]:mp)
{
if(cnt>=n/2+(n&1))
{
cout<<str;
return 0;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3412kb
input:
5 red green red red blue
output:
red
result:
ok "red"
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3420kb
input:
3 red blue yellow
output:
result:
wrong answer Unexpected EOF in the participants output