Submission #402886

#TimeUsernameProblemLanguageResultExecution timeMemory
402886EJOI2019AndrewBoxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
#include "boxes.h" long long delivery(int N, int K, int L, int p[]) { if(K==1) { long long int ans = 0; for(int i = 0; i < N; ++i) ans+=min((long long)p[i],(long long)L-p[i])*2; return ans; } }

Compilation message (stderr)

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:8:18: error: 'min' was not declared in this scope
    8 |             ans+=min((long long)p[i],(long long)L-p[i])*2;
      |                  ^~~
boxes.cpp:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^