Submission #639294

# Submission time Handle Problem Language Result Execution time Memory
639294 2022-09-09T11:09:03 Z LucaLucaM CONSUL (info1cup19_consul) C++17
Compilation error
0 ms 0 KB
#include "grader.h"
#include <bits/stdc++.h>

using namespace std;

void solve(int n)
{
    int Q;
    
    if (n <= 50)
        Q = 50
    else
        Q = 60;

    for (int q = 0; q<Q; q+=2)
    {
        int i;
        i = rand();
        i %= n, i++;

        i = kth(i);
        if (cnt(i) > n/3)
        {
            say_answer(i);
            return;
        }
    }

    say_answer(-1);
}

Compilation message

consul.cpp: In function 'void solve(int)':
consul.cpp:11:15: error: expected ';' before 'else'
   11 |         Q = 50
      |               ^
      |               ;
   12 |     else
      |     ~~~~