# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72575 | funcsr | Cup of Jamshid (IOI17_cup) | C++17 | 4 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"
#include <iostream>
using namespace std;
#define rep(i, n) for (int i=0; i<(n); i++)
long long query(int x, int y) {
return ask_shahrasb(x-1e9, y-5e8);
}
std::vector<int> find_cup() {
long long g = query(0, 0);
long long X = 0;
rep(k, 29) if (((query((1LL<<k), 0)>>(k+1))&1) == ((g>>(k+1))&1)) X |= 1<<k;
rep(_, 2) rep(_2, 2){
long long x = X;
if(_)x^=1LL<<29;
if(_2)x^=1LL<<30;
long long y = x^g;
x -= 1e9;
y -= 5e8;
//cout<<"("<<x<<","<<y<<")\n";
if (x<-5e8||x>5e8||y<-5e8||y>5e8) continue;
//cout<<"ask="<<ask_shahrasb(x-1,y)<<"\n";
//if(ask_shahrasb(x-1,y)==1) return {(int)x,(int)y};
return {(int)x,(int)y};
}
abort();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |