Submission #472738

#TimeUsernameProblemLanguageResultExecution timeMemory
472738flappybirdCup of Jamshid (IOI17_cup)C++14
0 / 100
1 ms204 KiB
#include "cup.h" #include <bits/stdc++.h> using namespace std; typedef int ll; ll e = 28; vector<int> find_cup() { vector<ll> ans(2); ll a, b; a = b = 0; ll i; ll res = ask_shahrasb(-1 << e, -1 << e); for (i = e; i >= 1; i--) { ll loc = 1 << (i - 1); if (res & loc) { ll r = ask_shahrasb(a - loc * 2, b); if (r & (loc * 2)) a += loc / 2, b -= (loc + 1) / 2; else a -= (loc + 1) / 2, b += loc / 2; } else { ll r = ask_shahrasb(a - loc * 2, b); if (r & (loc * 2)) a += loc / 2, b += loc / 2; else a -= (loc + 1) / 2, b -= (loc + 1) / 2; } } ans[0] = a; ans[1] = b; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...