# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
26713 | grands | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 1882 ms | 25672 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.
#define B(x,h) (x&(1 << h))
int encode(int n, int x, int y) {
int h = 0, cntx = 0, cnty = 0;
while (h != 10){
bool X = B(x, h);
bool Y = B(y, h);
h++;
cntx += X;
cnty += Y;
if (X > Y){
return h;
}
}
h = 0;
while (h != 5){
bool X = B(cntx, h);
bool Y = B(cnty, h);
h++;
if (X < Y){
return 10 + h;
}
}
}
int decode(int n, int q, int h) {
if (h <= 10){
h -= 1;
bool Q = (q&(1 << h));
return Q;
}
else{
int i = h - 11, cntq = 0;
h = 0;
while (h != 10){
bool Q = (q&(1 << h));
h++;
cntq += Q;
}
bool Q = (cntq&(1 << i));
return !Q;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |