Submission #639106

# Submission time Handle Problem Language Result Execution time Memory
639106 2022-09-08T15:12:21 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;
    cin >> n;

    int Q = 25 + 5*(n > 50);

    Q = min(Q, n);
    for (int query = 0; query<Q; query++)
    {
        int i;
        i = chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count();
        i = abs(i), i %= n, i++;

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

    say_answer(-1);

    return 0;
}

Compilation message

consul.cpp: In function 'void solve()':
consul.cpp:30:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   30 |     return 0;
      |            ^