Submission #1343715

#TimeUsernameProblemLanguageResultExecution timeMemory
1343715bethanceBoxes with souvenirs (IOI15_boxes)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
int N, K, L;
vector<int> positions;
int delivery(int N, int K, int L, vector<int> positions) {
	int ans = 0;
	int mid = L / 2;
	for (int i = 0; i < N; i++) {
		if (positions[i] <= mid) {
			ans += 2 * positions[i];
		} else {
			ans += 2 * (N - positions[i]);
		}
	}
	return ans;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccz5wPX1.o: in function `main':
grader.c:(.text.startup+0x1e4): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status