답안 #127897

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
127897 2019-07-10T08:16:48 Z Utaha Broken Device (JOI17_broken_device) C++14
컴파일 오류
0 ms 0 KB
#include "Annalib.h"

void Anna( int N, long long X, int K, int P[] ){
	X^=0xba84d9302917c854;
	bool ret[150]={0};
	bool notused[150]={0};
	for(int i=0;i<K;i++){
		notused[P[i]]=1;
	}
	int pt=38;
	for(int i=0;i<N;i+=2){

		long long type=X%3;
		X/=3;

		if(type==0){
			if(notused[i]) continue;
			ret[i]=1;
			ret[i+1]=0;
		}
		else if(type==1){
			if(notused[i+1]) continue;
			ret[i]=0;
			ret[i+1]=1;
		}
		else{
			if(notused[i]||notused[i+1]) continue;
			ret[i]=ret[i+1]=1;
		}
		pt--;
		if(pt==0) break;
	}
	for(int i=0;i<N;i++) Set(i,ret[i]);
}
#include "Annalib.h"

void Anna( int N, long long X, int K, int P[] ){
	X^=0xba84d9302917c854;
	bool ret[150]={0};
	bool notused[150]={0};
	for(int i=0;i<K;i++){
		notused[P[i]]=1;
	}
	int pt=38;
	for(int i=0;i<N;i+=2){

		long long type=X%3;
		X/=3;

		if(type==0){
			if(notused[i]) continue;
			ret[i]=1;
			ret[i+1]=0;
		}
		else if(type==1){
			if(notused[i+1]) continue;
			ret[i]=0;
			ret[i+1]=1;
		}
		else{
			if(notused[i]||notused[i+1]) continue;
			ret[i]=ret[i+1]=1;
		}
		pt--;
		if(pt==0) break;
	}
	for(int i=0;i<N;i++) Set(i,ret[i]);
}

Compilation message

/tmp/ccgMjAOU.o: In function `main':
grader_bruno.cpp:(.text.startup+0x126): undefined reference to `Bruno(int, int*)'
/tmp/cckOyO5E.o: In function `Anna(int, long long, int, int*)':
Bruno.cpp:(.text+0x15c): undefined reference to `Set(int, int)'
collect2: error: ld returned 1 exit status