QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#272763#7879. Colorful Balloonsucup-team266#WA 1ms3504kbC++14273b2023-12-02 19:06:392023-12-02 19:06:39

Judging History

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

  • [2023-12-02 19:06:39]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3504kb
  • [2023-12-02 19:06:39]
  • 提交

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'