books.cpp: In function 'long long int sum_cycles(Component&, std::vector<int>&)':
books.cpp:25:35: error: 'abs' is not a member of 'std'
25 | long long diff = std::abs(current - p[current]);
| ^~~
books.cpp: In function 'long long int minimum_walk(std::vector<int>, int)':
books.cpp:38:15: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} [-Wsign-compare]
38 | if (i != p[i]) {
books.cpp:63:15: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} [-Wsign-compare]
63 | if (i == p[i] && !in_block) {
books.cpp:74:15: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
74 | if (i == block_end) {
| ~~^~~~~~~~~~~~
books.cpp:81:11: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
81 | if (s < first_unsolved) {
| ~~^~~~~~~~~~~~~~~~
books.cpp:83:18: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
83 | } else if (s > last_unsolved) {
| ~~^~~~~~~~~~~~~~~