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>
using namespace std;
using ll = long long int;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef vector<vii> vvii;
#define F first
#define S second
long long count_swaps(vector<int> s) {
ll n;
n = s.size(); n /= 2;
ll ans = 0;
for (ll i = 0; n > i; i++){
for (ll j = 2*i+1; 2*n > j; j++){
if (s[j] == -s[i]){
for (ll k = j; k > 2*i+1; k--){
swap(s[k],s[k-1]);
ans++;
}
}
}
if (s[2*i] > 0){
swap(s[2*i],s[2*i+1]);
ans++;
}
}
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... |