이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 q=0;int x=-1;
int cntt=0;
while(q<60 && x==-1 && cntt<(2*n)/3){
int w=kth(rng()%n+1);q++;
if(mp.count(w)) continue;
int how=cnt(w);cntt+=how;
if(how>(n/3)) x=w;
mp[x]=how;
q++;
}
say_answer(x);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |