답안 #369384

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
369384 2021-02-21T13:43:18 Z doowey CONSUL (info1cup19_consul) C++14
100 / 100
36 ms 492 KB
#include <bits/stdc++.h>
#include "grader.h"

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

#define fi first
#define se second
#define mp make_pair


void solve(int n)
{
    vector<int> xa(n);
    for(int i = 0 ;i < n; i ++ ){
        xa[i]=i+1;
    }
    random_shuffle(xa.begin(), xa.end());
    int cur;
    int Q = 0;
    for(int i = 0 ; i < n; i ++ ){
        if(Q <= 48){
            cur = kth(xa[i]);
            if(cnt(cur) > n/3){
                say_answer(cur);
                return;
            }
            Q += 2;
        }

    }
    say_answer(-1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 364 KB Output is correct
2 Correct 8 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 364 KB Output is correct
2 Correct 22 ms 364 KB Output is correct
3 Correct 8 ms 364 KB Output is correct
4 Correct 8 ms 364 KB Output is correct
5 Correct 21 ms 364 KB Output is correct
6 Correct 24 ms 364 KB Output is correct
7 Correct 16 ms 492 KB Output is correct
8 Correct 25 ms 364 KB Output is correct
9 Correct 27 ms 364 KB Output is correct
10 Correct 14 ms 380 KB Output is correct
11 Correct 31 ms 364 KB Output is correct
12 Correct 28 ms 364 KB Output is correct
13 Correct 36 ms 364 KB Output is correct
14 Correct 20 ms 364 KB Output is correct