books.cpp: In function 'void go(int, long long int)':
books.cpp:14:10: error: 'max' was not declared in this scope
l[k] = max(v, l[k]);
^~~
books.cpp:14:10: note: suggested alternative:
In file included from /usr/include/c++/7/vector:60:0,
from books.h:1,
from books.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:265:5: note: 'std::max'
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
books.cpp:17:10: error: 'min' was not declared in this scope
r[k] = min(v, r[k]);
^~~
books.cpp:17:10: note: suggested alternative:
In file included from /usr/include/c++/7/vector:60:0,
from books.h:1,
from books.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:243:5: note: 'std::min'
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
books.cpp:20:5: error: 'p' was not declared in this scope
go(p[v], c + (long long)abs(v - p[v]));
^
books.cpp:20:26: error: 'abs' was not declared in this scope
go(p[v], c + (long long)abs(v - p[v]));
^~~
books.cpp: In function 'long long int minimum_walk(std::vector<int>, int)':
books.cpp:25:2: error: 'memset' was not declared in this scope
memset(r, -1, sizeof r);
^~~~~~
books.cpp:27:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < p.size(); i++){
~~^~~~~~~~~~
books.cpp:35:9: error: 'max' was not declared in this scope
loc = max(loc, r[i]);
^~~
books.cpp:35:9: note: suggested alternative:
In file included from /usr/include/c++/7/vector:60:0,
from books.h:1,
from books.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:265:5: note: 'std::max'
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~