#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 |
18 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
344 KB |
Output is correct |
2 |
Correct |
16 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
436 KB |
Output is correct |
2 |
Correct |
20 ms |
436 KB |
Output is correct |
3 |
Correct |
14 ms |
440 KB |
Output is correct |
4 |
Correct |
14 ms |
432 KB |
Output is correct |
5 |
Correct |
20 ms |
440 KB |
Output is correct |
6 |
Correct |
20 ms |
444 KB |
Output is correct |
7 |
Correct |
20 ms |
440 KB |
Output is correct |
8 |
Correct |
20 ms |
444 KB |
Output is correct |
9 |
Correct |
22 ms |
440 KB |
Output is correct |
10 |
Correct |
21 ms |
440 KB |
Output is correct |
11 |
Correct |
20 ms |
436 KB |
Output is correct |
12 |
Correct |
20 ms |
436 KB |
Output is correct |
13 |
Correct |
21 ms |
692 KB |
Output is correct |
14 |
Correct |
20 ms |
436 KB |
Output is correct |