답안 #746901

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
746901 2023-05-23T08:23:38 Z vjudge1 Calvinball championship (CEOI15_teams) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

long long delivery(int N, int K, int L, vector<int> positions) {
	long long ans = 0;
	for (int i = N - 1; i >= 0; i -= K) {
		if (positions[max(0, i - K + 1)] > L / 2)
			ans += 2 * (L - positions[i - K + 1]);
		else if (positions[i] > L / 2)
			ans += L;
		else
			ans += 2 * positions[i];
		cerr << positions[i] << ", " << ans << endl;
	}
	return ans;
}

Compilation message

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status