Submission #639293

#TimeUsernameProblemLanguageResultExecution timeMemory
639293LucaLucaMCONSUL (info1cup19_consul)C++17
Compilation error
0 ms0 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; void solve(int n) { 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 (stderr)

consul.cpp: In function 'void solve(int)':
consul.cpp:9:9: error: 'Q' was not declared in this scope
    9 |         Q = 50
      |         ^
consul.cpp:13:23: error: 'Q' was not declared in this scope
   13 |     for (int q = 0; q<Q; q+=2)
      |                       ^