Submission #315014

# Submission time Handle Problem Language Result Execution time Memory
315014 2020-10-22T00:34:25 Z casperwang CONSUL (info1cup19_consul) C++14
85 / 100
37 ms 384 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;

const int MAXN = 1000;
int v[MAXN+1];

void solve(int N) {
  srand(time(NULL));
  for (int i = 1; i <= N; i++)
    v[i] = -1;
  for (int i = 1; i <= 30; i++) {
    int p = rand() % N + 1;
    while (v[p] != -1) p = rand() % N + 1;
    v[p] = kth(p);
    int c = cnt(v[p]);
    if (c * 3 > N) {
      say_answer(v[p]);
      return;
    }
  }
  say_answer(-1);
  return;
}

# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 256 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 256 KB Output is correct
2 Correct 8 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 256 KB Output is correct
2 Correct 18 ms 288 KB Output is correct
3 Correct 7 ms 256 KB Output is correct
4 Correct 9 ms 256 KB Output is correct
5 Correct 23 ms 384 KB Output is correct
6 Correct 25 ms 256 KB Output is correct
7 Correct 28 ms 256 KB Output is correct
8 Correct 36 ms 256 KB Output is correct
9 Correct 23 ms 256 KB Output is correct
10 Correct 31 ms 256 KB Output is correct
11 Correct 30 ms 256 KB Output is correct
12 Correct 32 ms 256 KB Output is correct
13 Correct 37 ms 256 KB Output is correct
14 Correct 24 ms 256 KB Output is correct