답안 #347041

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
347041 2021-01-11T15:24:57 Z ACmachine 질문 (CEOI14_question_grader) C++17
컴파일 오류
0 ms 0 KB
int encode (int n, int x, int y) {
    int res;
    if(x > y){
        REP(j, 12){
            if((x & (1 << j))&&!(y & (1 << j))){
                res = j;
                break;
            }
        }
    }
    else{
        REP(j, 12){
            if(!(x & (1 << j)) && (y & (1 << j))){
                res = j;
                break;
            }
        }
    }
    return res;
}
int decode (int n, int q, int h) {
    return (q & (1 << h));
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:4:13: error: 'j' was not declared in this scope
    4 |         REP(j, 12){
      |             ^
encoder.cpp:4:9: error: 'REP' was not declared in this scope
    4 |         REP(j, 12){
      |         ^~~
encoder.cpp:12:13: error: 'j' was not declared in this scope
   12 |         REP(j, 12){
      |             ^
encoder.cpp:12:9: error: 'REP' was not declared in this scope
   12 |         REP(j, 12){
      |         ^~~