foo.cc: In function 'int getMinSwaps(std::vector<int>&)':
foo.cc:16:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
16 | for (int i = 0; i < sortedNums.size(); i++)mp[sortedNums[i]] = i ;//记录下标索引
| ~~^~~~~~~~~~~~~~~~~~~
foo.cc:19:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
19 | for (int i = 0; i < nums.size();i++)
| ~~^~~~~~~~~~~~~
foo.cc: In function 'int main()':
foo.cc:31:22: error: expected ';' before 'for'
31 | scanf("%d",&n)
| ^
| ;
32 | for(int i=0;i<n;i++){
| ~~~
foo.cc:32:21: error: 'i' was not declared in this scope
32 | for(int i=0;i<n;i++){
| ^
[Hydro](https://hydro.ac)提供评测服务