Submission #168718

# Submission time Handle Problem Language Result Execution time Memory
168718 2019-12-15T13:47:16 Z mhy908 Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
100 / 100
1504 ms 125168 KB
int c[930], r, f;
int encode(int N, int x, int y)
{
    if(!f)for(int i=1; i<=4096; i++)if(__builtin_popcount(i)==6)c[++r]=i;
    f=1;
    return __builtin_ffs(c[x]&(c[x]^c[y]));
}
int c[930], r, f;
int decode(int N, int q, int h)
{
    if(!f)for(int i=1; i<=4096; i++)if(__builtin_popcount(i)==6)c[++r]=i;
    f=1;
    return c[q]&(1<<(h-1))?1:0;
}
# Verdict Execution time Memory Grader output
1 Correct 1496 ms 125168 KB Output is correct - maxh = 12
2 Correct 1504 ms 125144 KB Output is correct - maxh = 12