제출 #1122979

#제출 시각아이디문제언어결과실행 시간메모리
1122979heey선물상자 (IOI15_boxes)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#define f first
#define s second
#define all(x) (x).begin(), (x).end()
#define mod 1'000'000'007
#define inf 1'000'000'000'000'00
#define pb push_back
#define vvi vector<vi>
#define fst ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
#include "boxes.h"


long long delivery(int n, int k, int L, int a[]){
	int res = INT_MAX;
	vector<int> dpc(n+1), dpcc(n+1);
	for(int i = 1; i <= n; i++){
		if(i >= k) dpc[i] = dpc[i-k];
		dpc[i] += 2*a[i-1];
	}

	for(int i = n-1; i >= 0; i--){
		if(i < n-k) dpcc[i] = dpcc[i+k];
		dpcc[i] += 2*(L - a[i]);
	}

	
	for(int i = 0; i <= n; i++){
 		res = min(res, dpc[i] + dpcc[i]);
	}
	return res;
}


signed main(){
	fst
	int n, k, l; cin >> n >> k >> l;
	int a[n];
	for(int i = 0; i < n; i++) cin>>a[i];
	cout << delivery(n, k, l, a);
}

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

/usr/bin/ld: /tmp/cclXHYsP.o: in function `main':
grader.c:(.text.startup+0x0): multiple definition of `main'; /tmp/ccLag4dP.o:boxes.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status