Submission #314149

# Submission time Handle Problem Language Result Execution time Memory
314149 2020-10-18T18:14:35 Z a_player Library (JOI18_library) C++14
Compilation error
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}),exit(0);
	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/ccxjHJlz.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/ccnsyorh.o:grader.cpp:(.text+0x0): first defined here
/tmp/ccxjHJlz.o:(.bss+0x0): multiple definition of `__my_judge_::judge'
/tmp/ccnsyorh.o:(.bss+0x0): first defined here
/tmp/ccxjHJlz.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/ccnsyorh.o:grader.cpp:(.text+0x360): first defined here
/tmp/ccxjHJlz.o: In function `main':
library.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccnsyorh.o:grader.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status