boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:11:24: warning: declaration of 'N' shadows a global declaration [-Wshadow]
11 | long long delivery(int N, int K, int L, int p[]) {
| ~~~~^
boxes.cpp:5:11: note: shadowed declaration is here
5 | const int N=1e7+10;
| ^
boxes.cpp:13:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
13 | sort(p,p+N);
| ^~~~
| std::sort
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:3:
/usr/include/c++/10/bits/stl_algo.h:4880:5: note: 'std::sort' declared here
4880 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
boxes.cpp:23:19: error: 'min' was not declared in this scope; did you mean 'std::min'?
23 | pre[i]=me+min(h,N-h);
| ^~~
| 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:3:
/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:24:17: error: 'k' was not declared in this scope
24 | if(cur==k){
| ^
boxes.cpp:37:18: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
37 | me+=abs(h-lst);
| ~^~~~
boxes.cpp:39:19: error: 'min' was not declared in this scope; did you mean 'std::min'?
39 | suf[i]=me+min(h,N-h);
| ^~~
| 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:3:
/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:40:17: error: 'k' was not declared in this scope
40 | if(cur==k){
| ^
boxes.cpp:11:31: warning: unused parameter 'K' [-Wunused-parameter]
11 | long long delivery(int N, int K, int L, int p[]) {
| ~~~~^
boxes.cpp:11:38: warning: unused parameter 'L' [-Wunused-parameter]
11 | long long delivery(int N, int K, int L, int p[]) {
| ~~~~^