Submission #922483

#TimeUsernameProblemLanguageResultExecution timeMemory
922483maxFedorchukCONSUL (info1cup19_consul)C++17
100 / 100
10 ms352 KiB
#include "bits/stdc++.h" #include "grader.h" using namespace std; /* const long long MX=2e5+10; int v[MX]; int k[MX]; int sz; int kth(int i) { return v[i]; } int cnt(int zn) { int rt=0; for(int i=1;i<=sz;i++) { rt+=(v[i]==zn); } return rt; } void say_answer(int a) { cout<<a<<"\n"; exit(0); } */ void solve(int n) { for(int i=0;i<25;i++) { int zn=kth(((1ll*(rand()%n+1)*(rand()%n+1))%n+1)); int kl=cnt(zn); if(kl>(n/3)) { say_answer(zn); return; } } say_answer(-1); } /* int main() { cin.tie(0); ios_base::sync_with_stdio(0); cin>>sz; for(int i=1;i<=sz;i++) { cin>>v[i]; } solve(sz); return 0; } */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...