#include "grader.h"
//#include "grader.cpp"
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
void solve(int n)
{
int x;
map<int,bool>mp;
int vis[1001]={0};
int cur=100;
bool ok=0;
while(cur--)
{
x=rand()%n+1;
if(vis[x]) continue;
vis[x]=1;
int y=kth(x);
if(!mp[y])
{
mp[y]=1;
if(cnt(y)>n/3)
{
ok=1;
say_answer(y);
break;
}
}
}
if(!ok) say_answer(-1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
15 ms |
364 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
42 ms |
364 KB |
Output is partially correct |
2 |
Correct |
11 ms |
364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
37 ms |
492 KB |
Output is partially correct |
2 |
Partially correct |
59 ms |
364 KB |
Output is partially correct |
3 |
Correct |
8 ms |
492 KB |
Output is correct |
4 |
Correct |
7 ms |
364 KB |
Output is correct |
5 |
Partially correct |
43 ms |
364 KB |
Output is partially correct |
6 |
Partially correct |
59 ms |
364 KB |
Output is partially correct |
7 |
Partially correct |
51 ms |
364 KB |
Output is partially correct |
8 |
Partially correct |
40 ms |
364 KB |
Output is partially correct |
9 |
Partially correct |
56 ms |
364 KB |
Output is partially correct |
10 |
Partially correct |
49 ms |
364 KB |
Output is partially correct |
11 |
Partially correct |
32 ms |
364 KB |
Output is partially correct |
12 |
Partially correct |
57 ms |
364 KB |
Output is partially correct |
13 |
Partially correct |
62 ms |
364 KB |
Output is partially correct |
14 |
Partially correct |
58 ms |
364 KB |
Output is partially correct |