Submission #95928

# Submission time Handle Problem Language Result Execution time Memory
95928 2019-02-04T12:17:10 Z Bodo171 Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
27 / 100
1281 ms 81160 KB
int lsb(int x)
{
    return ((x^(x-1))&x);
}
int norm[2000];
int encode (int n, int x, int y) {
  for(int i=0;i<=9;i++)
    norm[(1<<i)]=i+1;
  return norm[lsb((x^y))]+10*((lsb((x^y))&x)!=0);
}


int decode (int n, int q, int h) {
    int ret=0;
    if(h>10)
    {
        h-=11;
        if((q&(1<<h))) ret=1;
        else ret=0;
    }
    else
    {
        h--;
        if((q&(1<<h))) ret=0;
        else ret=1;
    }
    return ret;
}
# Verdict Execution time Memory Grader output
1 Partially correct 1281 ms 80880 KB Output is partially correct - maxh = 20
2 Partially correct 1270 ms 81160 KB Output is partially correct - maxh = 20