Submission #639295

# Submission time Handle Problem Language Result Execution time Memory
639295 2022-09-09T11:09:20 Z LucaLucaM CONSUL (info1cup19_consul) C++17
100 / 100
28 ms 296 KB
#include "grader.h"
#include <bits/stdc++.h>

using namespace std;

void solve(int n)
{
    int Q;

    if (n <= 50)
        Q = 50;
    else
        Q = 60;

    for (int q = 0; q<Q; q+=2)
    {
        int i;
        i = rand();
        i %= n, i++;

        i = kth(i);
        if (cnt(i) > n/3)
        {
            say_answer(i);
            return;
        }
    }

    say_answer(-1);
}
# Verdict Execution time Memory Grader output
1 Correct 9 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 16 ms 208 KB Output is correct
2 Correct 6 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 288 KB Output is correct
2 Correct 10 ms 208 KB Output is correct
3 Correct 6 ms 288 KB Output is correct
4 Correct 6 ms 296 KB Output is correct
5 Correct 19 ms 292 KB Output is correct
6 Correct 19 ms 208 KB Output is correct
7 Correct 24 ms 292 KB Output is correct
8 Correct 28 ms 296 KB Output is correct
9 Correct 19 ms 288 KB Output is correct
10 Correct 27 ms 292 KB Output is correct
11 Correct 16 ms 288 KB Output is correct
12 Correct 16 ms 208 KB Output is correct
13 Correct 19 ms 292 KB Output is correct
14 Correct 19 ms 208 KB Output is correct