답안 #168721

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
168721 2019-12-15T13:51:08 Z mhy908 질문 (CEOI14_question_grader) C++14
100 / 100
1497 ms 79856 KB
int c[930],r,f,i=1;
int encode(int N,int x,int y){
    if(!f)for(;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,i=1;
int decode(int N,int q,int h){
    if(!f)for(;i<=4096;i++)if(__builtin_popcount(i)==6)c[++r]=i;f=1;
    return c[q]&(1<<(h-1))?1:0;
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:3:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if(!f)for(;i<=4096;i++)if(__builtin_popcount(i)==6)c[++r]=i;f=1;
     ^~
encoder.cpp:3:65: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     if(!f)for(;i<=4096;i++)if(__builtin_popcount(i)==6)c[++r]=i;f=1;
                                                                 ^

decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:3:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if(!f)for(;i<=4096;i++)if(__builtin_popcount(i)==6)c[++r]=i;f=1;
     ^~
decoder.cpp:3:65: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     if(!f)for(;i<=4096;i++)if(__builtin_popcount(i)==6)c[++r]=i;f=1;
                                                                 ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1489 ms 79856 KB Output is correct - maxh = 12
2 Correct 1497 ms 79448 KB Output is correct - maxh = 12