books.cpp: In function 'long long int minimum_walk(std::vector<int>, int)':
books.cpp:33:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
33 | for(int i = 0; i < p.size(); i++)if(p[i] != i)ans += abs(p[i]-i), cs.pb({min(i, p[i]), max(i, p[i])}), pmin = min(pmin, i), pmax = max(pmax, i);
| ~~^~~~~~~~~~
books.cpp:38:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
38 | while(r < p.size() && p[r] == r)r++;
| ~~^~~~~~~~~~
books.cpp:40:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
40 | else if(r == p.size()) ans += 2*(s-l);
| ~~^~~~~~~~~~~
books.cpp:42:6: error: redeclaration of 'int r'
42 | int r = cs.front().ff;
| ^
books.cpp:36:13: note: 'int r' previously declared here
36 | int l = s, r = s;
| ^
books.cpp:43:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
43 | for(int i = 0; i < cs.size(); i++){
| ~~^~~~~~~~~~~