답안 #820675

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
820675 2023-08-11T05:24:44 Z dashka 질문 (CEOI14_question_grader) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
 
#define pb push_back
 
vector<vector<int> > w;
bool woltemar;
 
int decode (int n, int q, int h) {
	if(!woltemar) {
		woltemar = true;
		w.pb({});
		vector<int> subset = {0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0};
		for(int i = 0; i < 924; i++) {
			w.pb(subset);
			/*int j = -1, cnt = 0;
			for(int i = 12; i >= 1; i--) {
				if(!subset[i]) {
					j = i;
					break;
				}
				cnt++;
			}
			for(; j >= 1; j--) {
				if(subset[j]) {
					subset[j] = false;
					for(int i = j + 1; i <= j + 1 + cnt; i++) {
						subset[i] = true;
					}
					for(int i = j + 1 + cnt + 1; i <= 12; i++) {
						subset[i] = false;
					}
					break;
				}
			}*/
			next_permutation(subset.begin(), subset.end());
		}
	}
	return ((w[q][h] == -1) ? 1 : 0);
}
#include <bits/stdc++.h>
using namespace std;
 
#define pb push_back
 
vector<vector<int> > w;
bool woltemar;
 
int decode (int n, int q, int h) {
	if(!woltemar) {
		woltemar = true;
		w.pb({});
		vector<int> subset = {0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0};
		for(int i = 0; i < 924; i++) {
			w.pb(subset);
			/*int j = -1, cnt = 0;
			for(int i = 12; i >= 1; i--) {
				if(!subset[i]) {
					j = i;
					break;
				}
				cnt++;
			}
			for(; j >= 1; j--) {
				if(subset[j]) {
					subset[j] = false;
					for(int i = j + 1; i <= j + 1 + cnt; i++) {
						subset[i] = true;
					}
					for(int i = j + 1 + cnt + 1; i <= 12; i++) {
						subset[i] = false;
					}
					break;
				}
			}*/
			next_permutation(subset.begin(), subset.end());
		}
	}
	return ((w[q][h] == -1) ? 1 : 0);
}

Compilation message

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