记录详情

Compile Error

foo.cc: In function 'void selectSort()':
foo.cc:21:25: error: 'swap' was not declared in this scope
   21 |                         swap(a[i],a[minIndex]);
      |                         ^~~~
foo.cc:21:25: note: suggested alternatives:
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/utility:70,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/algorithm:60,
                 from foo.cc:1:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_pair.h:533:5: note:   'std::swap'
  533 |     swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
      |     ^~~~
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_pair.h:59,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/utility:70,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/algorithm:60,
                 from foo.cc:1:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/move.h:196:5: note:   'std::swap'
  196 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
4 排序中的交换次数
比赛
2022暑期青少年社团(告别赛)
语言
C++
递交时间
2022-08-21 22:55:56
评测时间
2022-08-21 22:55:56
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes