Submission #413861

#TimeUsernameProblemLanguageResultExecution timeMemory
413861ChaskaBoxes with souvenirs (IOI15_boxes)C++11
Compilation error
0 ms0 KiB
#include "boxes.h" #include <bits/stdc++.h> long long delivery(int N, int K, int L, int p[]) { long long ans = 0; ans = min(p[N-1]+min(p[N-1],L-p[N-1]),p[0]+min(p[0],L-p[0])); return ans; }

Compilation message (stderr)

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:5:24: error: 'min' was not declared in this scope; did you mean 'std::min'?
    5 |       ans = min(p[N-1]+min(p[N-1],L-p[N-1]),p[0]+min(p[0],L-p[0]));
      |                        ^~~
      |                        std::min
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from boxes.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
boxes.cpp:5:13: error: 'min' was not declared in this scope; did you mean 'std::min'?
    5 |       ans = min(p[N-1]+min(p[N-1],L-p[N-1]),p[0]+min(p[0],L-p[0]));
      |             ^~~
      |             std::min
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from boxes.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
boxes.cpp:3:31: warning: unused parameter 'K' [-Wunused-parameter]
    3 | long long delivery(int N, int K, int L, int p[]) {
      |                           ~~~~^