Submission #54442

#TimeUsernameProblemLanguageResultExecution timeMemory
54442MoNsTeR_CuBeBoxes with souvenirs (IOI15_boxes)C++17
Compilation error
0 ms0 KiB
#include "boxes.h" #include <bits/stdc++.h> #define int long long using namespace std; long long delivery(int N, int K, int L, int p[]) { int tot = 0; for(int i = 0; i < N; i++){ int cost = min(p[i], L-p[i]); tot+=(cost*2); } return tot; } /* int main(){ int N, K, L; cin >> N >> K >> L; int tab[N]; for(int i = 0; i < N; i++){ cin >> tab[i]; } cout << delivery(N,K,L,tab) << endl; } */

Compilation message (stderr)

boxes.cpp: In function 'long long int delivery(long long int, long long int, long long int, long long int*)':
boxes.cpp:6:31: warning: unused parameter 'K' [-Wunused-parameter]
 long long delivery(int N, int K, int L, int p[]) {
                               ^
/tmp/ccr0FBKX.o: In function `main':
grader.c:(.text.startup+0x22f): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status