제출 #529708

#제출 시각아이디문제언어결과실행 시간메모리
529708pokmui9909질문 (CEOI14_question_grader)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<ll> V;

int encode(int n, int x, int y){
    if(V.empty()){
        for(int i = 0; i < (1 << 12); i++){
            if(__builtin_popcount(i) == 6){
                V.push_back(i);
            }
        }
    }
    for(int i = 0; i < 12; i++){
        if((V[x] & (1 << i)) && !(V[y] & (1 << i))){
            return i + 1;
        }
    }
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<ll> V;

int decode(int n, int q, int h){
    h--;
    if(V.empty()){
        for(int i = 0; i < (1 << 12); i++){
            if(__builtin_popcount(i) == 6){
                V.push_back(i);
            }
        }
    }
    return !!(V2[q] & (1 << h));
}

컴파일 시 표준 에러 (stderr) 메시지

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:19:1: warning: control reaches end of non-void function [-Wreturn-type]
   19 | }
      | ^

decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:15:15: error: 'V2' was not declared in this scope; did you mean 'V'?
   15 |     return !!(V2[q] & (1 << h));
      |               ^~
      |               V