# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
905285 | 2024-01-12T22:14:04 Z | rainboy | Cup of Jamshid (IOI17_cup) | C++17 | 1 ms | 348 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |