제출 #705178

#제출 시각아이디문제언어결과실행 시간메모리
705178bin9638선물상자 (IOI15_boxes)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define fs first #define sc second #define N 1010 #define pb push_back #define int ll ll dp[1010][1010]; int delivery(int n,int k,int l,int a[]) { sort(a,a+n); int res=0; for(int i=0;i<n;i++) res+=min(a[i],l-a[i])*2; return res; } #ifdef SKY int32_t main() { freopen("A.inp","r",stdin); freopen("A.out","w",stdout); // ios::sync_with_stdio(0); // cin.tie(NULL); // cout.tie(NULL); int n,k,l; cin>>n>>k>>l; int a[n]; for(int i=0;i<n;i++) cin>>a[i]; cout<<delivery(n,k,l,a); return 0; } #endif // SKY

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

boxes.cpp: In function 'long long int delivery(long long int, long long int, long long int, long long int*)':
boxes.cpp:14:24: warning: unused parameter 'k' [-Wunused-parameter]
   14 | int delivery(int n,int k,int l,int a[])
      |                        ^
/usr/bin/ld: /tmp/ccTXE1AB.o: in function `main':
grader.c:(.text.startup+0x1ef): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status