Submission #864679

# Submission time Handle Problem Language Result Execution time Memory
864679 2023-10-23T12:21:41 Z Trisanu_Das Mađioničar (COI22_madionicar) C++17
Compilation error
0 ms 0 KB
#icldue <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

Main.cpp:1:2: error: invalid preprocessing directive #icldue; did you mean #include?
    1 | #icldue <bits/stdc++.h>
      |  ^~~~~~
      |  include
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:3: error: 'cout' was not declared in this scope
    6 |   cout << "? " << i + 1 << ' ' << j + 1 << endl;
      |   ^~~~
Main.cpp:1:1: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
  +++ |+#include <iostream>
    1 | #icldue <bits/stdc++.h>
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;
      |                                   ^
Main.cpp:6:44: error: 'endl' was not declared in this scope
    6 |   cout << "? " << i + 1 << ' ' << j + 1 << endl;
      |                                            ^~~~
Main.cpp:1:1: note: 'std::endl' is defined in header '<ostream>'; did you forget to '#include <ostream>'?
  +++ |+#include <ostream>
    1 | #icldue <bits/stdc++.h>
Main.cpp:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> x;
      |   ^~~
Main.cpp:7:3: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
Main.cpp: In function 'int main()':
Main.cpp:12:10: error: 'cin' was not declared in this scope
   12 |   int n; cin >> n;
      |          ^~~
Main.cpp:12:10: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
Main.cpp:16:11: error: 'max' was not declared in this scope
   16 |     ans = max(ans, l);
      |           ^~~
Main.cpp:18:3: error: 'cout' was not declared in this scope
   18 |   cout << "? " << ans << endl;
      |   ^~~~
Main.cpp:18:3: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
Main.cpp:18:26: error: 'endl' was not declared in this scope
   18 |   cout << "? " << ans << endl;
      |                          ^~~~
Main.cpp:18:26: note: 'std::endl' is defined in header '<ostream>'; did you forget to '#include <ostream>'?