답안 #168130

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
168130 2019-12-11T13:15:27 Z dimash241 도서관 (JOI18_library) C++17
컴파일 오류
0 ms 0 KB
#include "library.h"

#include<bits/stdc++.h>

#define pb push_back 
using namespace std;

int Query (const vector < int > &m) {};
void Answer(const vector < int > &m) {}; 

void Solve(int n) {
	vector <int> m(n);

	m[0] = 1;
	int mx = 0, p = 0;
	for(int i = 1; i < n; i ++) {
		m[i] = 1;
		int x;
		x = Query(m);
		if (x > mx) {
			mx = x;
			p = i;
		}
		m[i] = 0;
	}
	vector < pair < int, int > > res;
	m[0] = 0;
	//m[p] = 1;
	for (int i = 0; i < n; i ++) {
		m[p] = 1;
		m[i] = 1;
		res.pb({Query(m), i});
		m[p] = 0;
		m[i] = 0;
		
	} 
	sort(res.begin(), res.end());
	vector < int > ans;
	for (int i = 0; i < n; i ++)
		ans.pb(res[i].second);

	Answer(ans);
}


// B...a

Compilation message

library.cpp: In function 'int Query(const std::vector<int>&)':
library.cpp:8:38: warning: no return statement in function returning non-void [-Wreturn-type]
 int Query (const vector < int > &m) {};
                                      ^
/tmp/cc3dsOWM.o: In function `Query(std::vector<int, std::allocator<int> > const&)':
library.cpp:(.text+0x30): multiple definition of `Query(std::vector<int, std::allocator<int> > const&)'
/tmp/cceWF8VP.o:grader.cpp:(.text+0x140): first defined here
/tmp/cc3dsOWM.o: In function `Answer(std::vector<int, std::allocator<int> > const&)':
library.cpp:(.text+0x40): multiple definition of `Answer(std::vector<int, std::allocator<int> > const&)'
/tmp/cceWF8VP.o:grader.cpp:(.text+0x4a0): first defined here
collect2: error: ld returned 1 exit status