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 "shoes.h"
#include <bits/stdc++.h>
#define F first
#define S seond
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
using namespace std;
typedef long long ll;
const int MAXN = (int)1e6 + 7;
const int MOD = 998244353;
const int INF = (int)1e9 + 7;
int n, m, t, tmp, tmp2, tmp3, u, v, w, ans;
ll count_swaps(vector<int> s) {
n = s.size()/2;
ans = 0;
tmp = 0;
while (tmp != n) {
int j = 2*tmp;
// cout << "!" << tmp << endl;
while (s[j] >= 0) j++;
while (j != 2*tmp) {
swap(s[j], s[j-1]);
ans++; j--;
}
j = 2*tmp+1;
while (s[j] != 0-s[2*tmp]) j++;
while (j != 2*tmp+1) {
swap(s[j], s[j-1]);
ans++; j--;
}
tmp++;
}
return ans;
}
# | 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... |