답안 #318525

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
318525 2020-11-02T09:11:46 Z johutha CONSUL (info1cup19_consul) C++17
100 / 100
29 ms 384 KB
#include "grader.h"
#include <random>
#include <iostream>

using namespace std;

void solve(int n)
{
    int mb = (n > 50 ? 30 : 25);

    mt19937 rng(n^mb);
    uniform_int_distribution<int> uni(0, 1e9);

    for (int i = 0; i < mb; i++)
    {
        int ind = uni(rng) % n;
        int cand = kth(ind + 1);
        int app = cnt(cand);
        if (app > n / 3) 
        {
            say_answer(cand);
            return;
        }
    }
    say_answer(-1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 364 KB Output is correct
2 Correct 8 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 384 KB Output is correct
2 Correct 24 ms 364 KB Output is correct
3 Correct 8 ms 364 KB Output is correct
4 Correct 9 ms 364 KB Output is correct
5 Correct 20 ms 364 KB Output is correct
6 Correct 26 ms 384 KB Output is correct
7 Correct 21 ms 364 KB Output is correct
8 Correct 28 ms 364 KB Output is correct
9 Correct 26 ms 364 KB Output is correct
10 Correct 14 ms 364 KB Output is correct
11 Correct 25 ms 364 KB Output is correct
12 Correct 21 ms 364 KB Output is correct
13 Correct 29 ms 364 KB Output is correct
14 Correct 26 ms 364 KB Output is correct