Submission #54016

#TimeUsernameProblemLanguageResultExecution timeMemory
54016ernestvwBoxes with souvenirs (IOI15_boxes)C++11
0 / 100
2 ms428 KiB
#include <bits/stdc++.h> using namespace std; //#define int long long void fast_io() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int n, k, l; int delivery(int N, int K, int L, int *positions) { n = N, k = K, l = L; if(k == n) { int ans = L; for(int i = 0; i < n; i++) { int cur = 2 * positions[i]; if(i<n-1)cur += 2 * (L - positions[i+1]); ans = min(ans, cur); } return ans; } } /* signed main() { fast_io(); }*/

Compilation message (stderr)

boxes.cpp: In function 'int delivery(int, int, int, int*)':
boxes.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#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...