Transcript
![Page 1: int64 count swaps(int[] S) - IOI 2019 › source › Tasks › Day1 › Shoes › CHN.pdf · int64 count_swaps(int[] S) count_swaps([2, 1, -1, -2]) Shoes (1 of 3) 2 1 -1-2 2-1 1-2](https://reader034.vdocuments.mx/reader034/viewer/2022042310/5ed79dbbdff44a19a36e8b17/html5/thumbnails/1.jpg)
int64count_swaps(int[]S)
count_swaps([2,1,-1,-2])
Shoes (1 of 3)
![Page 2: int64 count swaps(int[] S) - IOI 2019 › source › Tasks › Day1 › Shoes › CHN.pdf · int64 count_swaps(int[] S) count_swaps([2, 1, -1, -2]) Shoes (1 of 3) 2 1 -1-2 2-1 1-2](https://reader034.vdocuments.mx/reader034/viewer/2022042310/5ed79dbbdff44a19a36e8b17/html5/thumbnails/2.jpg)
2 1 -1 -2
2 -1 1 -2
2 -1 -2 1
2 -2 -1 1
-2 2 -1 1
count_swaps([-2,2,2,-2,-2,2])
Shoes (2 of 3)
![Page 3: int64 count swaps(int[] S) - IOI 2019 › source › Tasks › Day1 › Shoes › CHN.pdf · int64 count_swaps(int[] S) count_swaps([2, 1, -1, -2]) Shoes (1 of 3) 2 1 -1-2 2-1 1-2](https://reader034.vdocuments.mx/reader034/viewer/2022042310/5ed79dbbdff44a19a36e8b17/html5/thumbnails/3.jpg)
count_swaps
Shoes (3 of 3)
int64count_swaps(int[]S)
count_swaps([2,1,-1,-2])
Shoes (1 of 3)
2 1 -1 -2
2 -1 1 -2
2 -1 -2 1
2 -2 -1 1
-2 2 -1 1
count_swaps([-2,2,2,-2,-2,2])
Shoes (2 of 3)
count_swaps
Shoes (3 of 3)