books.cpp: In function 'long long int minimum_walk(std::vector<int>, int)':
books.cpp:39:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
39 | 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:45: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]
45 | for(int i = 0; i < cs.size(); i++){
| ~~^~~~~~~~~~~
books.cpp:52:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
52 | for(int i = 0; i < p.size(); i++){
| ~~^~~~~~~~~~
books.cpp:53:8: error: request for member 'count' in 's', which is of non-class type 'int'
53 | if(s.count(i))continue;
| ^~~~~
books.cpp:54:8: error: request for member 'lower_bound' in 's', which is of non-class type 'int'
54 | if(s.lower_bound(i) != s.lower_bound(p[i]))add(p, i);
| ^~~~~~~~~~~
books.cpp:54:28: error: request for member 'lower_bound' in 's', which is of non-class type 'int'
54 | if(s.lower_bound(i) != s.lower_bound(p[i]))add(p, i);
| ^~~~~~~~~~~
books.cpp:59:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
59 | while(r < p.size() && !poss.count(r))r++;
| ~~^~~~~~~~~~
books.cpp:61:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
61 | else if(r == p.size()) ans += 2*(s-l);
| ~~^~~~~~~~~~~