Submission #705179

#TimeUsernameProblemLanguageResultExecution timeMemory
705179bin9638Boxes with souvenirs (IOI15_boxes)C++17
10 / 100
1 ms340 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 ll dp[1010][1010]; ll delivery(int n,int k,int l,int a[]) { sort(a,a+n); ll res=0; for(int i=0;i<n;i++) res+=1ll*min(a[i],l-a[i])*2; return res; } #ifdef SKY int 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(int, int, int, int*)':
boxes.cpp:13:23: warning: unused parameter 'k' [-Wunused-parameter]
   13 | ll delivery(int n,int k,int l,int a[])
      |                   ~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...