답안 #977933

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
977933 2024-05-08T14:05:06 Z KasymK 선물상자 (IOI15_boxes) C++17
컴파일 오류
0 ms 0 KB
#include "bits/stdc++.h"
#include "boxes.h"

using namespace std;

long long delivery(int n, int k, int l, vector<int> positions){
    long long answer = 0;
    for(int i = 0; i < n; ++i)
        answer += (min(positions[i], l - positions[i]) * 2LL);
    return answer;
}

Compilation message

boxes.cpp: In function 'long long int delivery(int, int, int, std::vector<int>)':
boxes.cpp:6:31: warning: unused parameter 'k' [-Wunused-parameter]
    6 | long long delivery(int n, int k, int l, vector<int> positions){
      |                           ~~~~^
/usr/bin/ld: /tmp/ccVi0TpE.o: in function `main':
grader.c:(.text.startup+0x1ef): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status