# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1260827 | niepamietamhasla | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++20 | 0 ms | 0 KiB |
void obliczv1(){
int c = 1;
while(v1.size() < 921){
if(__builtin_popcount(c) == 6) v1.push_back(c);
c++;
}
return;
}
int encode(int n, int x, int y){
obliczv1();
int i1 = v1[x];
int i2 = v1[y];
for(int i = 0; i < 12; ++i){
if((i1 & (1 << i)) and !(i2 & (1 << i))){
return i + 1;
}
}
return 0;
}
void obliczv2(){
int c = 1;
while(v2.size() < 921){
if(__builtin_popcount(c) == 6) v2.push_back(c);
c++;
}
return;
}
int decode(int n, int q, int h){
obliczv2();
int licz = v2[q];
h--;
if(licz & (1 << h)){
return 1;
}
else{
return 0;
}
return -1;
}