제출 #257578

#제출 시각아이디문제언어결과실행 시간메모리
257578doowey질문 (CEOI14_question_grader)C++14
0 / 100
7044 ms5212 KiB
#include <bits/stdc++.h>

using namespace std;


int compute(int id){
    int cnt = 0;
    for(int i = 0 ;i < (1 << 12); i ++ ){
        if(__builtin_popcount(i) == 6){
            if(cnt == id) return i;
            cnt ++ ;
        }
    }
}

int encode (int n, int x, int y) {
    x = compute(x);
    y = compute(y);
    for(int i = 0 ; i < 12; i ++ ){
        if((x & (1 << i)) && !(y & (1 << i))){
            return i + 1;
        }
    }
    return -1;
}
#include <bits/stdc++.h>

using namespace std;

int get(int id){
    int cnt = 0;
    for(int i = 0 ;i < (1 << 12); i ++ ){
        if(__builtin_popcount(i) == 6){
            if(cnt == id) return i;
            cnt ++ ;
        }
    }
}

int decode (int n, int q, int h) {
    q = get(q);
    h--;
    if((q & (1 << h))) return true;
    else return false;
}

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

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

decoder.cpp: In function 'int get(int)':
decoder.cpp:13:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...