답안 #168730

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
168730 2019-12-15T14:04:34 Z mhy908 질문 (CEOI14_question_grader) C++14
컴파일 오류
0 ms 0 KB
int c[930],r,i=4097;
int encode(int N,int x,int y){
    r?r:while(--i)__builtin_popcount(i)==6?c[++r]=i:r;
    return __builtin_ffs(c[x]&(c[x]^c[y]));
}
int c[930],r,i=4097;
int decode(int N,int q,int h){
    r?r:while(--i)__builtin_popcount(i)==6?c[++r]=i:r;
    return c[q]&1<<h-1?1:0;
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:3:9: error: expected primary-expression before 'while'
     r?r:while(--i)__builtin_popcount(i)==6?c[++r]=i:r;
         ^~~~~

decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:3:9: error: expected primary-expression before 'while'
     r?r:while(--i)__builtin_popcount(i)==6?c[++r]=i:r;
         ^~~~~
decoder.cpp:4:21: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
     return c[q]&1<<h-1?1:0;
                    ~^~