This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
#define endl '\n'
#include "grader.h"
void solve(int n){
mt19937 rng;
rng=mt19937(chrono::steady_clock::now().time_since_epoch().count());
set<int> ss;
for(int i=0;i<n;i++){
ss.insert(i+1);
}
for(int i=0;i<25;i++){
vector<int> tt;
for(auto j:ss){
tt.pb(j);
}
if(tt.size()==0){
break;
}
int xx=rng()%(tt.size());
int x=kth(tt[xx]);
if(cnt(x)>n/3){
say_answer(x);
return;
}
ss.erase(tt[xx]);
}
say_answer(-1);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |