Submission #170464

#TimeUsernameProblemLanguageResultExecution timeMemory
170464MounirCONSUL (info1cup19_consul)C++14
0 / 100
2 ms376 KiB
#include <bits/stdc++.h> #include "grader.h" using namespace std; int kth(int k); void say_answer(int k); int cnt(int k); 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...