#include "grader.h"
#include<bits/stdc++.h>
using namespace std;
void solve(int n)
{
/// insert your code
/// for example
set<int>checked;
srand(23543);
int cnt1=0;
for(;cnt1+2<=min(n,60);)
{
int i=rand()%n+1;
if(checked.find(i)!=checked.end())continue;
checked.insert(i);
cnt1+=2;
int val=kth(i);
if(cnt(val)*3>n)
{
say_answer(val);
return;
}
}
say_answer(-1);
return;
if(cnt(kth(1)) > n / 3) say_answer(kth(1));
else say_answer(-1);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
364 KB |
Output is correct |
2 |
Correct |
9 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
364 KB |
Output is correct |
2 |
Correct |
30 ms |
364 KB |
Output is correct |
3 |
Correct |
9 ms |
364 KB |
Output is correct |
4 |
Correct |
10 ms |
364 KB |
Output is correct |
5 |
Correct |
27 ms |
364 KB |
Output is correct |
6 |
Correct |
31 ms |
364 KB |
Output is correct |
7 |
Correct |
29 ms |
364 KB |
Output is correct |
8 |
Correct |
33 ms |
364 KB |
Output is correct |
9 |
Correct |
29 ms |
364 KB |
Output is correct |
10 |
Correct |
22 ms |
364 KB |
Output is correct |
11 |
Correct |
28 ms |
364 KB |
Output is correct |
12 |
Correct |
19 ms |
364 KB |
Output is correct |
13 |
Correct |
36 ms |
364 KB |
Output is correct |
14 |
Correct |
25 ms |
364 KB |
Output is correct |