# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
383247 | 2021-03-29T09:54:19 Z | Ahmad_Hasan | CONSUL (info1cup19_consul) | C++17 | 38 ms | 380 KB |
#include<bits/stdc++.h> #include "grader.h" /** |||||||||| ||||| ||||| |||||||||| ||||||||||||| ||||| ||||| ||||| |||| |||||| ||||| ||||| ||||| ||||||||||||||||| ||||||||||||||| |||||||||| ||||||||||||||||||| ||||||||||||||| ||||| ||||| ||||| ||||| ||||| ||||| ||||| ||||| ||||| ||||| |||||||||| AHMED;HASSAN;SAEED; */ using namespace std; static const int MIN_VALUE = 0, MAX_VALUE = (1e9) - 1; static map<int,int> mp; static int Q, N, a[5005]; static bool issol, answer; void solve(int n){ vector<int>vis(n); for(int i=0;i<min(30,n/2);i++){ int ri=rand()%n; while(vis[ri]){ ri=rand()%n; } vis[ri]=1; int ret=kth(ri+1); int ret2=cnt(ret); if(ret2>((n)/3)){ say_answer(ret); return; } } say_answer(-1); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 24 ms | 364 KB | Output is correct |
2 | Correct | 9 ms | 364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 28 ms | 364 KB | Output is correct |
2 | Correct | 29 ms | 364 KB | Output is correct |
3 | Correct | 8 ms | 364 KB | Output is correct |
4 | Correct | 10 ms | 364 KB | Output is correct |
5 | Correct | 24 ms | 364 KB | Output is correct |
6 | Correct | 27 ms | 364 KB | Output is correct |
7 | Correct | 23 ms | 364 KB | Output is correct |
8 | Correct | 31 ms | 364 KB | Output is correct |
9 | Correct | 24 ms | 364 KB | Output is correct |
10 | Correct | 20 ms | 380 KB | Output is correct |
11 | Correct | 25 ms | 364 KB | Output is correct |
12 | Correct | 37 ms | 364 KB | Output is correct |
13 | Correct | 38 ms | 364 KB | Output is correct |
14 | Correct | 25 ms | 364 KB | Output is correct |