Submission #362259

#TimeUsernameProblemLanguageResultExecution timeMemory
362259alextodoranCup of Jamshid (IOI17_cup)C++17
100 / 100
2 ms364 KiB
/** ____ ____ ____ ____ ____ ||a |||t |||o |||d |||o || ||__|||__|||__|||__|||__|| |/__\|/__\|/__\|/__\|/__\| **/ #include <bits/stdc++.h> #include "cup.h" using namespace std; typedef long long ll; const int BITS = 30; int ask_shahrasb(int x, int y); vector <int> find_cup () { int d = 500000002; int xXORy = ask_shahrasb(0 - d, 0 - d); int x = 0, y = 0; for(int bit = 0; bit < BITS; bit++) { if(ask_shahrasb((1 << bit) - d, 0 - d) == (xXORy ^ (1 << bit))) x ^= (1 << bit); } y = x ^ xXORy; x -= d; y -= d; vector <int> answer; answer.push_back(x); answer.push_back(y); return answer; }
#Verdict Execution timeMemoryGrader output
Fetching results...