Submission #72563

#TimeUsernameProblemLanguageResultExecution timeMemory
72563idan_izmirliCup of Jamshid (IOI17_cup)C++14
100 / 100
2 ms376 KiB
#include "cup.h" using namespace std; std::vector<int> find_cup() { std::vector<int> result(2); long long power=1; long long x_dist=0; int corner=500000000; int base=ask_shahrasb(corner,corner); int current; while(power<corner) { current=ask_shahrasb(corner+power, corner); while((current&power)!=(base&power)) { x_dist+=power; power*=2; } x_dist-=power/2; } result[0]=corner-x_dist; if((power<2*corner)&&(result[0]-power>=-corner)) { current=ask_shahrasb(result[0]-power/2, corner); result[0]=corner-((base)^((current)^(power/2))); } result[1]=corner-((base)^(corner-result[0])); return result; }
#Verdict Execution timeMemoryGrader output
Fetching results...