답안 #565220

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
565220 2022-05-20T13:13:10 Z 1zaid1 저장 (Saveit) (IOI10_saveit) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
vector<int> v;
int encode (int n, int x, int y) {
    if (!v.size()) {
        for (int i = 0; i < (1<<12); i++) {
            int cnt = 0;
            for (int j = 0; j < 12; j++) if (i&(1<<j)) cnt++;
            if (cnt == 6) v.push_back(i);
        }
    }

    for (int k = 0; k < 12; k++) {
        if ((v[x-1]&(1<<k)) && !(v[y-1]&(1<<k))) return k+1;
    } return 0;
}
#include<bits/stdc++.h>
using namespace std;
vector<int> v;
int decode (int n, int q, int h) {
	if (!v.size()) {
        for (int i = 0; i < (1<<12); i++) {
            int cnt = 0;
            for (int j = 0; j < 12; j++) if (i&(1<<j)) cnt++;
            if (cnt == 6) v.push_back(i);
        }
    }

    return (v[q-1]&(1<<(h-1))) != 0;
}

Compilation message

/usr/bin/ld: /tmp/ccOPy9Nq.o: in function `main':
grader_encoder.c:(.text.startup+0x122): undefined reference to `encode(int, int, int, int*, int*)'
collect2: error: ld returned 1 exit status

/usr/bin/ld: /tmp/ccmxOiMe.o: in function `main':
grader_decoder.c:(.text.startup+0x126): undefined reference to `decode(int, int)'
collect2: error: ld returned 1 exit status