Submission #1145879

#TimeUsernameProblemLanguageResultExecution timeMemory
1145879idonoamCONSUL (info1cup19_consul)C++20
0 / 100
33 ms408 KiB
#include <bits/stdc++.h>
#include <cctype>
#include "grader.h"

using namespace std;


void solve(int n)
{
    vector<int> vec(n/2);
    for(int i = 0; i < n/2;i++){
        vec[i] = kth(i*2+1);
    }
    sort(vec.begin(), vec.end());
    long long  ls = vec[0], cou = 1;
    bool cont = true;
    for(int i = 1; i < n/2 && cont; i++){
        if(ls == vec[i]){
            if(++cou > n/6){
                if(cnt(ls) > n/3){
                    say_answer(ls);
                }
                else{cou = -n;}
                cont = false;
            }
        }
        else{
            ls = vec[i];
            cou = 1;
        }
    }
    if(cont){say_answer(-1);}
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...