Submission #307659

#TimeUsernameProblemLanguageResultExecution timeMemory
307659amunduzbaevBoxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; #define ll long long long long delivery(int n, int k, int m, int p[]) { ll ans=0; sort(p,p+n); if(k==1){ for(int i=0;i<n;i++){ int a=(p[i]<=l/2 ? p[i]:l-p[i]); ans+=2*a; } } return ans; }

Compilation message (stderr)

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:11:26: error: 'l' was not declared in this scope
   11 |             int a=(p[i]<=l/2 ? p[i]:l-p[i]);
      |                          ^
boxes.cpp:6:38: warning: unused parameter 'm' [-Wunused-parameter]
    6 | long long delivery(int n, int k, int m, int p[]) {
      |                                  ~~~~^