# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1251274 | mohamedboukerche55 | Arranging Shoes (IOI19_shoes) | C++20 | 0 ms | 0 KiB |
#include "shoes.h"
using namespace std;
long long count_swaps(std::vector<int> s)
{
int n = s.size() / 2;
long long swaps = 0;
long long l = 0;
long long r = 0;
for(int i = 0 ; i < n * (1 << 1) ; i++)
{
if(S[i] < 0)
{
l += abs(i - r);
p += 2;
}
}
swaps = l;
return swaps;
}