shoes.cpp:8:1: error: 'vector' does not name a type
8 | vector<pair<int, int>> same_size[MAXN];
| ^~~~~~
shoes.cpp:9:1: error: 'vector' does not name a type
9 | vector<pair<int, int>> matchings;
| ^~~~~~
shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:38:9: error: 'same_size' was not declared in this scope
38 | same_size[abs(shoes[i])].push_back({shoes[i], i});
| ^~~~~~~~~
shoes.cpp:44:14: error: 'same_size' was not declared in this scope
44 | sort(same_size[i].begin(), same_size[i].end());
| ^~~~~~~~~
shoes.cpp:44:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
44 | sort(same_size[i].begin(), same_size[i].end());
| ^~~~
| 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 shoes.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:4880:5: note: 'std::sort' declared here
4880 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
shoes.cpp:51:17: error: 'swap' was not declared in this scope
51 | swap(l, r);
| ^~~~
shoes.cpp:51:17: note: suggested alternatives:
In file included from /usr/include/c++/10/regex:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110,
from shoes.cpp:1:
/usr/include/c++/10/bits/regex.h:2141:5: note: 'std::__cxx11::swap'
2141 | swap(match_results<_Bi_iter, _Alloc>& __lhs,
| ^~~~
In file included from /usr/include/c++/10/exception:147,
from /usr/include/c++/10/ios:39,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from shoes.cpp:1:
/usr/include/c++/10/bits/exception_ptr.h:169:5: note: 'std::__exception_ptr::swap'
169 | swap(exception_ptr& __lhs, exception_ptr& __rhs)
| ^~~~
In file included from /usr/include/c++/10/bits/nested_exception.h:40,
from /usr/include/c++/10/exception:148,
from /usr/include/c++/10/ios:39,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from shoes.cpp:1:
/usr/include/c++/10/bits/move.h:189:5: note: 'std::swap'
189 | swap(_Tp& __a, _Tp& __b)
| ^~~~
shoes.cpp:55:13: error: 'matchings' was not declared in this scope
55 | matchings.push_back({l + 1, r + 1});
| ^~~~~~~~~
shoes.cpp:59:10: error: 'matchings' was not declared in this scope
59 | sort(matchings.begin(), matchings.end());
| ^~~~~~~~~
shoes.cpp:59:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
59 | sort(matchings.begin(), matchings.end());
| ^~~~
| 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 shoes.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:4880:5: note: 'std::sort' declared here
4880 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~