Submission #364096

# Submission time Handle Problem Language Result Execution time Memory
364096 2021-02-08T08:37:17 Z yasseenkamel CONSUL (info1cup19_consul) C++14
0 / 100
16 ms 364 KB
#include <bits/stdc++.h>
#include "grader.h"
//#include "grader.cpp"

using namespace std;

bool vis[1000000005];

void solve(int n){
    int a[n + 5];
    for(int i = 1 ; i <= n ; i ++){
        int x = kth(i);
        a[i] = x;
    }
    sort(a,a + n);
    int cnt = 1;
    for(int i = 2 ; i <= n ; i ++){
        if(a[i] != a[i - 1]){
            if(cnt > n / 3){
                say_answer(a[i - 1]);
                return;
            }
            cnt = 0;
        }
        cnt ++;
    }
    if(cnt > n / 3){
        say_answer(a[n]);
        return;
    }
    say_answer(-1);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 364 KB Wrong answer
2 Halted 0 ms 0 KB -