Submission #864681

#TimeUsernameProblemLanguageResultExecution timeMemory
864681Trisanu_DasMađioničar (COI22_madionicar)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int qry(int x, int y){ int x; cout << "? " << i + 1 << ' ' << j + 1 << endl; cin >> x; return x; } int main(){ int n; cin >> n; int ans = 0, l; for(int t = 0; t < 2; t++){ for(int i = 0, l = t; i < n; i++) while(i > 0 && i + l < n && qry(i - 1, i + l)) i--, l += 2; ans = max(ans, l); } cout << "? " << ans << endl; }

Compilation message (stderr)

Main.cpp: In function 'int qry(int, int)':
Main.cpp:5:7: error: declaration of 'int x' shadows a parameter
    5 |   int x;
      |       ^
Main.cpp:4:13: note: 'int x' previously declared here
    4 | int qry(int x, int y){
      |         ~~~~^
Main.cpp:6:19: error: 'i' was not declared in this scope
    6 |   cout << "? " << i + 1 << ' ' << j + 1 << endl;
      |                   ^
Main.cpp:6:35: error: 'j' was not declared in this scope
    6 |   cout << "? " << i + 1 << ' ' << j + 1 << endl;
      |                                   ^