QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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;
}
}
}
详细
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