Submission #523414

# Submission time Handle Problem Language Result Execution time Memory
523414 2022-02-07T15:37:41 Z Farhan_HY CONSUL (info1cup19_consul) C++14
100 / 100
29 ms 200 KB
#include<bits/stdc++.h>
#include "grader.h"

using namespace std;

map<int, bool> mp;

void solve(int n)
{
    mp.clear();
    srand(0);
    int q = 30;
    while(q--)
    {
        int i = rand() % n + 1;
        int x = kth(i);
        if(mp[x])
            continue;
        mp[x] = 1;
        int Count = cnt(x);
        if (Count > n / 3)
        {
            say_answer(x);
            return;
        }
    }
    say_answer(-1);
    /// insert your code
}
# Verdict Execution time Memory Grader output
1 Correct 11 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 17 ms 200 KB Output is correct
2 Correct 5 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 200 KB Output is correct
2 Correct 11 ms 200 KB Output is correct
3 Correct 8 ms 200 KB Output is correct
4 Correct 8 ms 200 KB Output is correct
5 Correct 14 ms 200 KB Output is correct
6 Correct 22 ms 200 KB Output is correct
7 Correct 18 ms 200 KB Output is correct
8 Correct 23 ms 200 KB Output is correct
9 Correct 16 ms 200 KB Output is correct
10 Correct 16 ms 200 KB Output is correct
11 Correct 19 ms 200 KB Output is correct
12 Correct 18 ms 200 KB Output is correct
13 Correct 29 ms 200 KB Output is correct
14 Correct 18 ms 200 KB Output is correct