const int N=925;
int ff1[N][12],tsz1=0;
int encode(int n,int x,int y) {
for (int i=0;i<(1<<12);i++) if (__builtin_popcount(i)==6) {
++tsz1;
for (int j=0;j<12;j++) if (i>>j&1) ff1[tsz1][j]=1;
}
for (int i=0;i<12;i++) if (ff1[x][i]&&!ff1[y][i]) return i+1;
return 15;
}
const int N=925;
int ff2[N][12],tsz2;
int decode(int n,int q,int h) {
for (int i=0;i<(1<<12);i++) if (__builtin_popcount(i)==6) {
++tsz2;
for (int j=0;j<12;j++) if (i>>j&1) ff2[tsz2][j]=1;
}
return ff2[q][h-1];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
67 ms |
47972 KB |
Execution killed with signal 11 |
2 |
Runtime error |
70 ms |
47952 KB |
Execution killed with signal 11 |