제출 #793513

#제출 시각아이디문제언어결과실행 시간메모리
793513MODDICarnival Tickets (IOI20_tickets)C++17
컴파일 에러
0 ms0 KiB
#include "tickets.h"
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<int> vl;
long long find_maximum(int k, vector<vi> x) {
	int n = x.size();
	int m = x[0].size();
	if(m == 1){
		ll sum = 0;
		for(int i = 0; i < n; i++)	sum += x[i][0];
		vector<vi> al(n);
		for(int i = 0; i < n; i++)
			al[i].pb(0);
			
		allocate_tickets(al);
		ll choose = sum / n, choose1 = (sum + n - 1) / n;
		ll ans1 = 0, ans2 = 0;
		for(int i = 0; i < n; i++){
			ans1 += abs(x[i][0] - choose);
			ans2 += abs(x[i][0] - choose1);
		}
		return max(ans1, ans2);
	}
	return 1;
}

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/ccoFKJtw.o: in function `allocate_tickets(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)':
grader.cpp:(.text+0x260): multiple definition of `allocate_tickets(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)'; /tmp/ccTnc3zt.o:tickets.cpp:(.text+0x260): first defined here
/usr/bin/ld: /tmp/ccoFKJtw.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccTnc3zt.o:tickets.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status