Submission #330406

#TimeUsernameProblemLanguageResultExecution timeMemory
330406kshitij_sodaniCONSUL (info1cup19_consul)C++14
100 / 100
49 ms416 KiB
//#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...