QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#277631 | #7879. Colorful Balloons | qwedc001 | WA | 7ms | 3860kb | C++17 | 483b | 2023-12-06 21:00:16 | 2023-12-06 21:00:17 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N=1e5+10;
map<string,LL>mp;
string s;
int main()
{
ios::sync_with_stdio(false);cin.tie(nullptr);
LL n;
cin>>n;
LL maxn=0;
string t;
for(int i=1;i<=n;i++)
{
cin>>s;
mp[s]++;
if(mp[s]>maxn)
{
t=s;
maxn=mp[s];
}
}
if(maxn==1&&n!=1)
{
cout<<"uh-oh"<<endl;
}
else cout<<t<<endl;
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3856kb
input:
5 red green red red blue
output:
red
result:
ok "red"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
3 red blue yellow
output:
uh-oh
result:
ok "uh-oh"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
1 abc
output:
abc
result:
ok "abc"
Test #4:
score: 0
Accepted
time: 7ms
memory: 3788kb
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: 3ms
memory: 3628kb
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'