Submission #315013

# Submission time Handle Problem Language Result Execution time Memory
315013 2020-10-22T00:34:24 Z 2qbingxuan CONSUL (info1cup19_consul) C++14
85 / 100
33 ms 384 KB
#include "grader.h"
#include <bits/stdc++.h>
#ifdef local
#define debug(args...) qqbx(#args, args)
template <typename ...T> void qqbx(const char *s, T ...args) {
    int cnt = sizeof...(T);
    (std::cerr << "(" << s << ") = (" , ... ,
         (std::cerr << args << (--cnt ? ", " : ")\n")));
}
#else
#define debug(...) ((void)0)
#endif // local
#define pb emplace_back
#define all(v) begin(v), end(v)
using namespace std;

void solve(int n)
{
    /// insert your code
    /// for example
    vector<int> p(n);
    iota(all(p), 1);
    mt19937 rng(7122);
    shuffle(all(p), rng);
    for(int i = 0; i < 30 && i < n; i++) {
        int x = kth(p[i]);
        if(cnt(x) > n / 3) {
            say_answer(x);
            return;
        }
    }
    say_answer(-1);
}
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 256 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 256 KB Output is correct
2 Correct 9 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 384 KB Output is correct
2 Correct 27 ms 384 KB Output is correct
3 Correct 10 ms 384 KB Output is correct
4 Correct 11 ms 256 KB Output is correct
5 Correct 29 ms 384 KB Output is correct
6 Correct 24 ms 256 KB Output is correct
7 Correct 32 ms 308 KB Output is correct
8 Correct 32 ms 256 KB Output is correct
9 Correct 30 ms 256 KB Output is correct
10 Correct 33 ms 256 KB Output is correct
11 Correct 32 ms 384 KB Output is correct
12 Correct 24 ms 256 KB Output is correct
13 Correct 29 ms 360 KB Output is correct
14 Correct 27 ms 256 KB Output is correct