QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#269120#7879. Colorful Balloonsucup-team1453#WA 19ms34876kbC++11773b2023-11-29 13:06:392023-11-29 13:06:39

Judging History

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

  • [2023-11-29 13:06:39]
  • 评测
  • 测评结果:WA
  • 用时:19ms
  • 内存:34876kb
  • [2023-11-29 13:06:39]
  • 提交

answer

#include<bits/stdc++.h>
#define L(i, j, k) for(int i = (j); i <= (k); ++i)
#define R(i, j, k) for(int i = (j); i >= (k); --i)
#define ll long long
#define vi vector <int>
#define sz(a) ((int) (a).size())
#define me(f, x) memset(f, x, sizeof(f))
#define uint unsigned int
#define ull unsigned long long 
#define i128 __int128
using namespace std; 
const int N = 1e6 + 7, mod = 998244353;
int n, m;
string s[N];
int main() {
//	freopen("data.txt", "r", stdin);
	ios :: sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin >> n;
	L(i, 1, n) {
		cin >> s[i];
	}
	sort(s + 1, s + n + 1);
	int mid = (n + 1) / 2;
	L(i, 1, n - mid + 1) {
		if(s[i] == s[i + mid - 1]) {
			cout << s[i] << '\n';
			return 0;
		}
	}
	cout << "uh-oh\n";
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 4ms
memory: 34828kb

input:

5
red
green
red
red
blue

output:

red

result:

ok "red"

Test #2:

score: 0
Accepted
time: 3ms
memory: 34868kb

input:

3
red
blue
yellow

output:

uh-oh

result:

ok "uh-oh"

Test #3:

score: 0
Accepted
time: 7ms
memory: 34808kb

input:

1
abc

output:

abc

result:

ok "abc"

Test #4:

score: 0
Accepted
time: 19ms
memory: 34876kb

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: 18ms
memory: 34836kb

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'