QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#277630#7879. Colorful Balloonsqwedc001WA 0ms3628kbC++17466b2023-12-06 20:59:032023-12-06 20:59:03

Judging History

你现在查看的是最新测评结果

  • [2023-12-06 20:59:03]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3628kb
  • [2023-12-06 20:59:03]
  • 提交

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 q;
    cin>>q;
    LL maxn=0;
    string t;
    while(q--)
    {
    	cin>>s;
    	mp[s]++;
    	if(mp[s]>maxn)
    	{
    		t=s;
    		maxn=mp[s];
    	}
    }
    if(maxn==1)
    {
    	cout<<"uh-oh"<<endl;
    }
    else cout<<t<<endl;
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3628kb

input:

5
red
green
red
red
blue

output:

red

result:

ok "red"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

3
red
blue
yellow

output:

uh-oh

result:

ok "uh-oh"

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3604kb

input:

1
abc

output:

uh-oh

result:

wrong answer 1st words differ - expected: 'abc', found: 'uh-oh'