#include<bits/stdc++.h>
#include "grader.h"
using namespace std;
map<int, bool> mp;
void solve(int n)
{
mp.clear();
srand(0);
int q = 30;
while(q--)
{
int i = rand() % n + 1;
int x = kth(i);
if(mp[x])
continue;
mp[x] = 1;
int Count = cnt(x);
if (Count > n / 3)
{
say_answer(x);
return;
}
}
say_answer(-1);
/// insert your code
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
200 KB |
Output is correct |
2 |
Correct |
5 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
18 ms |
200 KB |
Output is correct |
2 |
Correct |
11 ms |
200 KB |
Output is correct |
3 |
Correct |
8 ms |
200 KB |
Output is correct |
4 |
Correct |
8 ms |
200 KB |
Output is correct |
5 |
Correct |
14 ms |
200 KB |
Output is correct |
6 |
Correct |
22 ms |
200 KB |
Output is correct |
7 |
Correct |
18 ms |
200 KB |
Output is correct |
8 |
Correct |
23 ms |
200 KB |
Output is correct |
9 |
Correct |
16 ms |
200 KB |
Output is correct |
10 |
Correct |
16 ms |
200 KB |
Output is correct |
11 |
Correct |
19 ms |
200 KB |
Output is correct |
12 |
Correct |
18 ms |
200 KB |
Output is correct |
13 |
Correct |
29 ms |
200 KB |
Output is correct |
14 |
Correct |
18 ms |
200 KB |
Output is correct |