# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
347050 | ACmachine | 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.
int encode (int n, int x, int y) {
vector<int> sets(921, 0);
int id = 1;
for(int i = 0; i < 12; ++i){
for(int j = i + 1; j < 12; ++j){
for(int k = j + 1; k < 12; ++k){
for(int g = k + 1; g < 12; ++g){
for(int l = g + 1; l < 12; ++l){
for(int m = l + 1; m < 12; ++m){
sets[id++] = (1 << i) | (1 << j) | (1 << k) | (1 << g) | (1 << l) | (1 << m);
}
}
}
}
}
}
return sets[x]&~sets[y];
}
int decode (int n, int q, int h) {
vector<int> sets(921, 0);
int id = 1;
for(int i = 0; i < 12; ++i){
for(int j = i + 1; j < 12; ++j){
for(int k = j + 1; k < 12; ++k){
for(int g = k + 1; g < 12; ++g){
for(int l = g + 1; l < 12; ++l){
for(int m = l + 1; m < 12; ++m){
sets[id++] = (1 << i) | (1 << j) | (1 << k) | (1 << g) | (1 << l) | (1 << m);
}
}
}
}
}
}
return (sets[q] == h);
}