QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#269120 | #7879. Colorful Balloons | ucup-team1453# | WA | 19ms | 34876kb | C++11 | 773b | 2023-11-29 13:06:39 | 2023-11-29 13:06:39 |
Judging History
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'