답안 #230109

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
230109 2020-05-08T12:22:52 Z Ruxandra985 질문 (CEOI14_question_grader) C++14
0 / 100
10 ms 776 KB
#include <bits/stdc++.h>

int code[10000];

int ok1 , ok2;

int encode (int N, int x, int y){
    int elem , i , aux , cnt;
    if (!ok1){
        elem = 0;
        ok1 = 1;
        for (i = 0 ; i < (1 << 12) ; i++){

            aux = i;
            cnt = 0;
            while (aux){
                cnt += aux % 2;
                aux /= 2;
            }

            if (cnt == 6)
                code[++elem] = i;


        }


    }

    x = code[x];
    y = code[y];
    for (i = 0 ; i < 12 ; i++){

        if (((x & (1 << i)) == 0) && ((y & (1 << i)) != 0))
            return i;

    }

}
#include <bits/stdc++.h>

int code[10000];

int ok1 , ok2;

int decode (int N, int q, int h){

    int elem , i , aux , cnt;

    if (!ok2){
        elem = 0;
        ok2 = 1;
        for (i = 0 ; i < (1 << 12) ; i++){

            aux = i;
            cnt = 0;
            while (aux){
                cnt += aux % 2;
                aux /= 2;
            }

            if (cnt == 6)
                code[++elem] = i;


        }


    }

    q = code[q];

    if (q & (1 << h))
        return 0;
    return 1;

}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:39:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 768 KB the encoded value must be greater than or equal to 1
2 Incorrect 9 ms 776 KB the encoded value must be greater than or equal to 1