Submission #784252

#TimeUsernameProblemLanguageResultExecution timeMemory
784252HD1Arranging Shoes (IOI19_shoes)C++14
10 / 100
1 ms212 KiB
//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; 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...