# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
668513 | RambaXGorilla | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++17 | 0 ms | 0 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.
using namespace std;
int conv[930] = {};
void fillConv(){
if(conv[1]) return;
for(int i = 0, j = 0;i < 1 << 12;i++){
if(__builtin_popcount(i) == 6){
j++;
conv[j] = i;
}
}
}
int encode(int N, int X, int Y){
fillConv();
return __builtin_ctz(conv[X] ^ (conv[X] & conv[Y])) + 1;
}
int decode(int N, int Q, int H){
fillConv();
return (bool) (conv[Q] & 1 << H - 1);
}