This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//we are all lost trying to be someone.
#include "shoes.h"
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
#define sz(x) ll(x.size())
#define reve(x) reverse(x.begin(),x.end())
#define ff first
#define ss second
#define pb push_back
using namespace std;
typedef int ll;
typedef long double ld;
typedef pair<ll,ll> ii;
typedef pair<ll, ii >tri;
const ll MAX=1e7+100;
const ll mod=1e9;
const ll inf=1e9;
long long count_swaps(vector<int> c){
ll pos=0;
ll sum=0;
ll aux=-1;
ll j=0;
for(ll i=0; i<sz(c); i++){
if(c[i]!=aux){
j=i;
pos=j;
break;
}
aux*=-1;
}
for(ll i=j; i<sz(c); i++){
if(c[i]==aux and i!=pos){
sum+=i;
pos+=2;
}
}
return sum;
}
# | 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... |