Submission #905285

#TimeUsernameProblemLanguageResultExecution timeMemory
905285rainboyCup of Jamshid (IOI17_cup)C++17
100 / 100
1 ms348 KiB
#include "cup.h" using namespace std; typedef vector<int> vi; const int X = 1000000000, L = 30; vi find_cup() { int d = ask_shahrasb(-X, -X), x = -X; for (int l = 0; l < L; l++) if ((ask_shahrasb(-X + (1 << l), -X) ^ d) == (1 << l)) x += (1 << l); if (x < -X / 2) x += 1 << L; int y = (d ^ x + X) - X; return { x, y }; }

Compilation message (stderr)

cup.cpp: In function 'vi find_cup()':
cup.cpp:16:17: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
   16 |  int y = (d ^ x + X) - X;
      |               ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...