Submission #561370

#TimeUsernameProblemLanguageResultExecution timeMemory
561370mircea_007CONSUL (info1cup19_consul)C++17
0.12 / 100
3048 ms336 KiB
#include <stdio.h> #include <random> #include "grader.h" #define MAXN 1000 #define MAXQ 60 int viz[MAXN]; void solve( int N ){ std::mt19937 mt( clock() ); int q = MAXQ, i, val; for( i = 0 ; i < N ; i++ ) viz[i] = 0; for( ; q-- ; ){ while( viz[i = mt() % N] ); viz[i] = 1; if( cnt( val = kth( i + 1 ) ) * 3 > N ){ say_answer( val ); return; } } say_answer( -1 ); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...