제출 #783274

#제출 시각아이디문제언어결과실행 시간메모리
783274Gabriel2222Boxes with souvenirs (IOI15_boxes)C++11
컴파일 에러
0 ms0 KiB
#include "boxes.h" #include "bits/stdc++.h" int delivery(int N, int K, int L, int p[]) { int respuesta = 0; long long _ndice = 0; long long mitad = L / 2; while(_ndice < N){ if(p[_ndice] > mitad) respuesta += (L - p[_ndice]) * 2; else respuesta += p[_ndice * 2]; _ndice++; } return respuesta; }

컴파일 시 표준 에러 (stderr) 메시지

boxes.cpp:3:5: error: ambiguating new declaration of 'int delivery(int, int, int, int*)'
    3 | int delivery(int N, int K, int L, int p[]) {
      |     ^~~~~~~~
In file included from boxes.cpp:1:
boxes.h:4:11: note: old declaration 'long long int delivery(int, int, int, int*)'
    4 | long long delivery(int N, int K, int L, int p[]);
      |           ^~~~~~~~
boxes.cpp: In function 'int delivery(int, int, int, int*)':
boxes.cpp:3:25: warning: unused parameter 'K' [-Wunused-parameter]
    3 | int delivery(int N, int K, int L, int p[]) {
      |                     ~~~~^