# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72563 | idan_izmirli | Cup of Jamshid (IOI17_cup) | C++14 | 2 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |