Submission #126033

#TimeUsernameProblemLanguageResultExecution timeMemory
126033claudyCup of Jamshid (IOI17_cup)C++14
100 / 100
3 ms376 KiB
# include "cup.h" # include "bits/stdc++.h" using namespace std; # define ask ask_shahrasb vector<int> find_cup() { vector<int>ans(2); int orig = ask(0,0); int signx,signy; if(ask((1 << 29),0) & (1 << 29)) signx = -1; else signx = 1; if(ask(0,(1 << 29)) & (1 << 29)) signy = -1; else signy = 1; int x = 0; for(int i = 0;i < 29;i++) { if((orig ^ ask((1 << i) * -signx,0)) != (1 << i)) x += (1 << i); } int y = orig ^ x; x *= signx; y *= signy; ans[0] = x; ans[1] = y; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...