# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
124623 | mraron | Cup of Jamshid (IOI17_cup) | C++14 | 8 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 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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |