#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
int kth(int k);
void say_answer(int k);
int cnt(int k);
auto rng=bind(uniform_int_distribution<int>(1,1e9),mt19937(time(0)));
void solve(int n)
{
map<int,int> mp;
int ogr=0;
int q=0;int x=-1;
int cntt=0;
int need=(n/3)+1;
if(n<=50) ogr=50;
else ogr=60;
while(q<ogr && x==-1 && cntt<=n-need){
int w=kth(rng()%n+1);q++;
if(mp.count(w)) continue;
int how=cnt(w);cntt+=how;
if(how>=need) x=w;
mp[w]=how;
q++;
}
say_answer(x);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
200 KB |
Output is correct |
2 |
Correct |
5 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
200 KB |
Output is correct |
2 |
Partially correct |
10 ms |
200 KB |
Output is partially correct |
3 |
Correct |
6 ms |
200 KB |
Output is correct |
4 |
Correct |
5 ms |
200 KB |
Output is correct |
5 |
Correct |
9 ms |
200 KB |
Output is correct |
6 |
Correct |
10 ms |
200 KB |
Output is correct |
7 |
Correct |
10 ms |
200 KB |
Output is correct |
8 |
Correct |
8 ms |
200 KB |
Output is correct |
9 |
Correct |
8 ms |
200 KB |
Output is correct |
10 |
Correct |
9 ms |
200 KB |
Output is correct |
11 |
Correct |
10 ms |
200 KB |
Output is correct |
12 |
Correct |
10 ms |
200 KB |
Output is correct |
13 |
Correct |
11 ms |
200 KB |
Output is correct |
14 |
Correct |
7 ms |
200 KB |
Output is correct |