# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
315079 | 2020-10-22T02:13:37 Z | daniel920712 | CONSUL (info1cup19_consul) | C++14 | 161 ms | 256 KB |
#include "grader.h" #include "grader.h" #include <map> #include <time.h> #include <algorithm> using namespace std; map < int , int > all; int how[1005]; void solve(int n) { srand(time(NULL)); all.clear(); int i,t,big=0,xx=n,x,y; if(n<=50) { for(i=1;i<=n;i++) { t=kth(i); all[t]++; big=max(big,all[t]); if(all[t]>n/3) { say_answer(t); return; } if(big+(n-i)<=n/3) { say_answer(-1); return; } } say_answer(-1); } else { for(i=1;i<=n/3*2+3;i++) { t=kth(i); all[t]++; if(all[t]==3) { x=cnt(t); big=max(big,x); xx-=(x-3); } if(big>n/3) { say_answer(t); return; } } say_answer(-1); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 33 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 26 ms | 256 KB | Output is partially correct |
2 | Partially correct | 23 ms | 256 KB | Output is partially correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 161 ms | 256 KB | Output is partially correct |
2 | Halted | 0 ms | 0 KB | - |