Submission #283496

#TimeUsernameProblemLanguageResultExecution timeMemory
283496FlashGamezzzBoxes with souvenirs (IOI15_boxes)C++17
Compilation error
0 ms0 KiB
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <string>
#include <utility>
#include <vector>
using namespace std;

long teams[10000002];
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	long n, k, l;
	cin >> n >> k >> l;
	teams[0] = 0;
	for (long i = 1; i <= n; i++){
		cin >> teams[i];
	}
	teams[n+1] = l;
	long long ans = 1000000000000000000;
	for (long i = 0; i <= n; i++){
		long long t = 0;
		long j = i, count = 0;
		while (j >= 0){
			if (count == 0){
				t += 2*teams[j];
				count = k;
			}
			j--;
			count--;
		}
		j = i+1;
		count = 0;
		while (j <= n){
			if (count == 0){
				t += 2*(l-teams[j]);
				count = k;
			}
			j++;
			count--;
		}
		ans = min(ans, t);
	}
	cout << ans;
}

Compilation message (stderr)

/tmp/cc15CGXc.o: In function `main':
grader.c:(.text.startup+0x0): multiple definition of `main'
/tmp/ccTzKEZj.o:boxes.cpp:(.text.startup+0x0): first defined here
/tmp/cc15CGXc.o: In function `main':
grader.c:(.text.startup+0x1b4): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status