#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
void solve(int n) {
vector<int> a;
a.reserve(n);
for (int i = 1; i <= n; i++) a.push_back(i);
srand(time(NULL));
int queries = 30;
while (queries--) {
int i = (rand() % a.size()) + 1;
int x = kth(i);
if (cnt(x) > (n+2)/3) {say_answer(x); return;}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
344 KB |
Output is correct |
2 |
Correct |
15 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
444 KB |
Output is correct |
2 |
Correct |
20 ms |
436 KB |
Output is correct |
3 |
Correct |
13 ms |
440 KB |
Output is correct |
4 |
Correct |
14 ms |
436 KB |
Output is correct |
5 |
Correct |
24 ms |
440 KB |
Output is correct |
6 |
Correct |
21 ms |
440 KB |
Output is correct |
7 |
Correct |
22 ms |
440 KB |
Output is correct |
8 |
Correct |
21 ms |
444 KB |
Output is correct |
9 |
Correct |
20 ms |
436 KB |
Output is correct |
10 |
Correct |
23 ms |
436 KB |
Output is correct |
11 |
Correct |
21 ms |
436 KB |
Output is correct |
12 |
Correct |
21 ms |
436 KB |
Output is correct |
13 |
Correct |
20 ms |
436 KB |
Output is correct |
14 |
Correct |
21 ms |
432 KB |
Output is correct |