Submission #659103

#TimeUsernameProblemLanguageResultExecution timeMemory
659103Trisanu_DasAliens (IOI07_aliens)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int n, x, y; bool q(int i, int j){ if(min(i, j) < 1 || max(i, j) > n) return 0; cout << "examine " << i << ' ' << j << '\n'; string s; cin >> s; return s == "true"; } signed main(){ cin >> n >> x >> y; int x0 = x, x1 = x, y1 = y; for(int i = 1 << 30; i /= 2){ if(q(x1 + i, y) && q(x1 + i / 2, y) && q(x1 + i / 4, y)) x1 += i; if(q(x0 - i, y) && q(x0 - i / 2, y) && q(x0 - i / 4, y)) x0 -= i; if(q(x, y1 + i) && q(x, y1 + i / 2) && q(x, y1 + i / 4)) y1 += i; } int w = 2 * (x1 - x0 + 1), y0 = y1 - (x1 - x0); x = (x0 + x1) / 2; y = (y0 + y1) / 2; x0 = x1 = x; y0 = y1 = y; while(q(x0 - w, y)) x0 -= w; while(q(x1 + w, y)) x1 += w; while(q(x, y0 - w)) y0 -= w; while(q(x, y1 + w)) y1 += w; cout << "solution " << (x0 + x1) / 2 << ' ' << (y0 + y1) / 2 << '\n'; }

Compilation message (stderr)

aliens.cpp: In function 'int main()':
aliens.cpp:17:29: error: expected ';' before ')' token
   17 |  for(int i = 1 << 30; i /= 2){
      |                             ^
      |                             ;