# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
567809 | Halym2007 | Arranging Shoes (IOI19_shoes) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll count_swaps(vector <int> S) {
long long int n = S.size();
if (n == 1) {
if (S[0] < 0 and S[1] > 0) {
return 0;
}
else return 1;
}
else {
long long int ans = (n / 2) * (n / 2 - 1) / 2;
return ans;