Submission #498942

# Submission time Handle Problem Language Result Execution time Memory
498942 2021-12-26T19:36:59 Z cadmiumsky CONSUL (info1cup19_consul) C++14
85 / 100
28 ms 328 KB
#include <random>
#include <chrono>
#include "grader.h"
using namespace std;

mt19937 rng(time(0));

void solve(int N) {
  for(int i=0; i<30; i++) {
    int index=(rng()%N)+1;
    int val=kth(index);
    int freq=cnt(val);
    if(freq > N/3) {
      say_answer(val);
      return;
    }
  }
  say_answer(-1);
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 328 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 272 KB Output is correct
2 Correct 7 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 200 KB Output is correct
2 Correct 11 ms 200 KB Output is correct
3 Correct 7 ms 200 KB Output is correct
4 Correct 8 ms 256 KB Output is correct
5 Correct 26 ms 276 KB Output is correct
6 Correct 27 ms 272 KB Output is correct
7 Correct 21 ms 272 KB Output is correct
8 Correct 28 ms 256 KB Output is correct
9 Correct 14 ms 276 KB Output is correct
10 Correct 25 ms 256 KB Output is correct
11 Correct 23 ms 200 KB Output is correct
12 Correct 21 ms 256 KB Output is correct
13 Correct 27 ms 200 KB Output is correct
14 Correct 26 ms 272 KB Output is correct