답안 #118493

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
118493 2019-06-19T05:50:29 Z E869120 최후의 만찬 (IOI12_supper) C++14
컴파일 오류
0 ms 0 KB
#include "assistant.h"
#include <iostream>
#include <queue>
using namespace std;

int LIST[200009], B1[100009], B2[100009], B3[100009];
queue<int>Q; bool used[100009];

void Assist(unsigned char *A, int N, int K, int R) {
	for (int i = 0; i < N; i++) B1[i] = A[i];
	for (int i = 0; i < N; i++) B2[i] = A[i + N];
	for (int i = 0; i < K; i++) B3[i] = A[i + N + N];
	for (int i = 0; i < K; i++) used[i] = true;
	for (int i = 0; i < K; i++) LIST[i + N] = i;

	for (int i = 0; i < K; i++) { if (B3[i] == 0) Q.push(i + N); }
	for (int i = 0; i < N; i++) {
		LIST[i] = GetRequest();
		if (used[LIST[i]] == true) {
			// 無視する
		}
		else {
			int pos = -1;
			while (!Q.empty()) {
				int pos1 = Q.front();
				if (used[LIST[pos1]] == true) { pos = pos1; break; }
				else Q.pop();
			}
			PutBack(LIST[pos]);
			used[LIST[pos]] = false;
			used[LIST[i]] = true;
			if (!Q.empty()) Q.pop();
		}
		if (B2[i] == 0) Q.push(i);
	}
}



    

Compilation message

/tmp/ccP4aeqw.o: In function `main':
advisor_grader.cpp:(.text.startup+0xbd): undefined reference to `ComputeAdvice(int*, int, int, int)'
/tmp/ccmkVTds.o: In function `Assist(unsigned char*, int, int, int)':
advisor.cpp:(.text+0x14d): undefined reference to `GetRequest()'
advisor.cpp:(.text+0x1be): undefined reference to `PutBack(int)'
collect2: error: ld returned 1 exit status

/tmp/ccxoiXLj.o: In function `main':
assistant_grader.cpp:(.text.startup+0x1ed): undefined reference to `Assist(unsigned char*, int, int, int)'
collect2: error: ld returned 1 exit status