답안 #314151

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
314151 2020-10-18T18:15:45 Z a_player 도서관 (JOI18_library) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "library.h"
#include "grader.cpp"
using namespace std;

void Solve(int N)
{
	if(N==1){
		Answer({1});
		return;}
	vector<vector<int> > a(N+1);
	vector<int> M(N);
	for(int i=1;i<=N;i++)
	for(int j=1;j<i;j++){
		M[i-1]=1;
		M[j-1]=1;
		int p=Query(M);
		if(p==1){
			a[i].push_back(j);
			a[j].push_back(i);
		}
		M[i-1]=0;
		M[j-1]=0;
	}
	int in=-1;
	for(int i=1;i<=N;i++)if(a[i].size()==1)in=i;
  vector<int> sol;
	sol.push_back(in);
	M[in-1]=1;
	in=a[in][0];
	while(a[in].size()!=1){
		sol.push_back(in);
		M[in-1]=1;
		if(M[a[in][0]-1])in=a[in][1];
		else in=a[in][0];
	}
	sol.push_back(in);
	Answer(sol);
}

Compilation message

/tmp/ccP6UeMP.o: In function `Query(std::vector<int, std::allocator<int> > const&)':
library.cpp:(.text+0x0): multiple definition of `Query(std::vector<int, std::allocator<int> > const&)'
/tmp/ccpqdKyP.o:grader.cpp:(.text+0x0): first defined here
/tmp/ccP6UeMP.o:(.bss+0x0): multiple definition of `__my_judge_::judge'
/tmp/ccpqdKyP.o:(.bss+0x0): first defined here
/tmp/ccP6UeMP.o: In function `Answer(std::vector<int, std::allocator<int> > const&)':
library.cpp:(.text+0x10): multiple definition of `Answer(std::vector<int, std::allocator<int> > const&)'
/tmp/ccpqdKyP.o:grader.cpp:(.text+0x360): first defined here
/tmp/ccP6UeMP.o: In function `main':
library.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccpqdKyP.o:grader.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status