Submission #64912

#TimeUsernameProblemLanguageResultExecution timeMemory
64912InovakBoxes with souvenirs (IOI15_boxes)C++14
10 / 100
2 ms376 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; long long ans; long long delivery(int n, int k, int l, int p[]) { for(int i = 0; i < n; i++) { ans += min(p[i], l - p[i]) * 2; } return ans; } // //int main() { // int n, k, l, p[100]; // cin >> n >> k >> l; // for(int i = 0; i < n; i++) { // cin >> p[i]; // } // cout << delivery(n, k, l, p) << endl; //} /** 3 1 8 1 2 5 **/

Compilation message (stderr)

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:8:31: warning: unused parameter 'k' [-Wunused-parameter]
 long long delivery(int n, int k, int l, int p[]) {
                               ^
#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...