Submission #170462

#TimeUsernameProblemLanguageResultExecution timeMemory
170462MounirCONSUL (info1cup19_consul)C++14
0 / 100
2 ms380 KiB
#include <bits/stdc++.h> using namespace std; int kth(int i); int cnt(int x); void say_answer(int a); void solve(int N){ srand(42); int tot = 0; set<int> faits; while (tot <= 2*N/3){ int cur = kth((int)rand()%N); if (faits.count(cur) == 0){ // cout << cur << endl; int nCur = cnt(cur); if (nCur >= double(N)/3){ say_answer(cur); return; } tot += nCur; faits.insert(cur); } } say_answer(-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...