# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
114166 | mosesmayer | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++17 | 1318 ms | 80496 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.
int encode (int n, int x, int y) {
static int cnt = 0;
static int tbl[1000];
if (cnt == 0){
for (int i = 0; i < (1<<12); i++){
if (__builtin_popcount(i) == 6){
tbl[++cnt] = i;
if (cnt == 920) break;
}
}
}
int xx = tbl[x], yy = tbl[y];
for (int i = 0; i < 12; i++){
if (((xx >> i) & 1) == 1 && ((yy>>i)&1) == 0){
return i + 1;
}
}
return (x + y) % 2;
}
int decode (int n, int q, int h) {
static int cnt = 0;
static int tbl[1000];
if (cnt == 0){
for (int i = 0; i < (1<<12); i++){
if (__builtin_popcount(i) == 6){
tbl[++cnt] = i;
if (cnt == 920) break;
}
}
}
int num = tbl[q];
--h;
return (num>>h)&1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |