#include "grader.h"
void solve(int n)
{
if (n <= 40) {
for (int i = 1; i <= n; ++ i ) {
int x = kth(i);
if (cnt(x) > n/3) {
say_answer(x);
return;
}
}
}
else if (n <= 100) {
for (int i = 1; i <= n; i += 3) {
int x = kth(i);
if (cnt(x) > n/3) {
say_answer(x);
return;
}
}
}
else {
for (int i = 1; i <= n; i += 30) {
int x = kth(i);
if (cnt(x) > n/3) {
say_answer(x);
return;
}
}
}
say_answer(-1);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
15 ms |
256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
26 ms |
256 KB |
Output is partially correct |
2 |
Correct |
19 ms |
256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
27 ms |
256 KB |
Output is partially correct |
2 |
Partially correct |
33 ms |
256 KB |
Output is partially correct |
3 |
Correct |
15 ms |
256 KB |
Output is correct |
4 |
Correct |
9 ms |
256 KB |
Output is correct |
5 |
Partially correct |
31 ms |
256 KB |
Output is partially correct |
6 |
Partially correct |
36 ms |
256 KB |
Output is partially correct |
7 |
Partially correct |
28 ms |
256 KB |
Output is partially correct |
8 |
Partially correct |
35 ms |
256 KB |
Output is partially correct |
9 |
Partially correct |
33 ms |
256 KB |
Output is partially correct |
10 |
Partially correct |
36 ms |
256 KB |
Output is partially correct |
11 |
Partially correct |
31 ms |
256 KB |
Output is partially correct |
12 |
Partially correct |
30 ms |
256 KB |
Output is partially correct |
13 |
Partially correct |
39 ms |
256 KB |
Output is partially correct |
14 |
Partially correct |
37 ms |
256 KB |
Output is partially correct |