답안 #347085

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
347085 2021-01-11T17:34:04 Z ACmachine 질문 (CEOI14_question_grader) C++17
0 / 100
5711 ms 24804 KB
int sets[921];
    
int encode (int n, int x, int y) {
    int id = 1;
    if(id == 1){
        for(int i = 0; i < 12; ++i){
            for(int j = i + 1; j < 12; ++j){
                for(int k = j + 1; k < 12; ++k){
                    for(int g = k + 1; g < 12; ++g){
                        for(int l = g + 1; l < 12; ++l){
                            for(int m = l + 1; m < 12; ++m){
                                if(id <= 920)
                                    sets[id++] = (1 << i) | (1 << j) | (1 << k) | (1 << g) | (1 << l) | (1 << m);
                            }
                        }
                    }
                }
            }
        }
    }
    for(int i = 0; i < 12; ++i){
        if((sets[x]&(1 << i)) && !(sets[y]&(1 << i)))
            return i + 1;
    } 
}
int sets[921];    
int decode (int n, int q, int h) {
    int id = 1;
    if(id == 1){
        for(int i = 0; i < 12; ++i){
            for(int j = i + 1; j < 12; ++j){
                for(int k = j + 1; k < 12; ++k){
                    for(int g = k + 1; g < 12; ++g){
                        for(int l = g + 1; l < 12; ++l){
                            for(int m = l + 1; m < 12; ++m){
                                if(id <= 920)
                                    sets[id++] = (1 << i) | (1 << j) | (1 << k) | (1 << g) | (1 << l) | (1 << m);
                            }
                        }
                    }
                }
            }
        }
    }
    return (sets[q] &(1 << (h-1)));
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5711 ms 24376 KB wrong answer
2 Incorrect 5673 ms 24804 KB wrong answer