Compile Error

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)提供评测服务

信息

递交者
类型
递交
题目
P1220 4 排序中的交换次数
语言
C++
递交时间
2022-08-21 21:04:04
评测时间
2022-08-21 21:04:04
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes