Submission #705178

#TimeUsernameProblemLanguageResultExecution timeMemory
705178bin9638Boxes with souvenirs (IOI15_boxes)C++17
Compilation error
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

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: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