Submission #124623

#TimeUsernameProblemLanguageResultExecution timeMemory
124623mraronCup of Jamshid (IOI17_cup)C++14
100 / 100
8 ms376 KiB
#include "cup.h" #include<iostream> using namespace std; #define ask ask_shahrasb vector<int> find_cup() { vector<int> res(2); int minf=-1e9; int diff=ask(minf, minf); int bdiff=0; for(int i=0;i<31;++i) { int val=ask(minf, minf+(1<<i)); vector<int> holkul; for(int j=0;j<31;++j) { if(((1<<j)&val)!=((1<<j)&diff)) holkul.push_back(j); } if(holkul.size()==1) { bdiff^=1<<i; } } int adiff=0; for(int j=0;j<31;++j) { if(diff&(1<<j)) { adiff+=(bdiff&(1<<j))^(diff&(1<<j)); }else { adiff+=(bdiff&(1<<j)); } } res[0]=adiff+minf; res[1]=bdiff+minf; return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...