#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(0);
using ll = int64_t;
using ull = uint64_t;
using uint = uint32_t;
using ld = long double;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const ll LINF = ll(2e18) + ll(1e15);
const double EPS = 1e-8;
void solve(int n) {
vector<int> arr(n);
for(int i = 0; i < n; i++)
arr[i] = i + 1;
shuffle(arr.begin(), arr.end(), mt19937(time(0)));
set<int> has;
int tmp = 0;
for(int a : arr) {
int x = kth(a);
tmp++;
if(tmp == 60)
break;
if(has.count(x))
continue;
has.insert(x);
int w = cnt(x);
tmp++;
if(w > n / 3) {
say_answer(x);
return;
}
if(tmp == 60)
break;
}
say_answer(-1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
14 ms |
200 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
200 KB |
Output is correct |
2 |
Correct |
7 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
300 KB |
Output is correct |
2 |
Correct |
30 ms |
200 KB |
Output is correct |
3 |
Correct |
5 ms |
200 KB |
Output is correct |
4 |
Correct |
8 ms |
276 KB |
Output is correct |
5 |
Correct |
18 ms |
200 KB |
Output is correct |
6 |
Correct |
28 ms |
200 KB |
Output is correct |
7 |
Correct |
28 ms |
200 KB |
Output is correct |
8 |
Correct |
27 ms |
200 KB |
Output is correct |
9 |
Correct |
29 ms |
200 KB |
Output is correct |
10 |
Correct |
22 ms |
200 KB |
Output is correct |
11 |
Correct |
23 ms |
200 KB |
Output is correct |
12 |
Correct |
25 ms |
200 KB |
Output is correct |
13 |
Correct |
31 ms |
200 KB |
Output is correct |
14 |
Correct |
28 ms |
200 KB |
Output is correct |