#include "shoes.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define db(x) cerr << #x << " = " << x << " | "
#define dbg(x) cerr << #x << " = " << x << "\n"
long long count_swaps(std::vector<int> s) {
ll n = s.size()/2;
ll t = 0, p = 0;
for (ll i = 0; i < 2 * n; i++) {
if (s[i] < 0) {
// dbg("here");
t += abs(i - p);
p += 2;
}
}
return t;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |