Submission #316944

#TimeUsernameProblemLanguageResultExecution timeMemory
316944Jarif_RahmanArranging Shoes (IOI19_shoes)C++17
45 / 100
36 ms4472 KiB
#include <bits/stdc++.h> #define pb push_back #define f first #define sc second using namespace std; typedef long long int ll; typedef string str; ll count_swaps(vector<int> s){ int n = s.size()/2; ll cnt = 0; vector <int> v, sth; for(int i = 0; i < n; i++) v.pb(2*i); for(int i = 0; i < 2*n; i++) if(s[i] < 0) sth.pb(i); for(int i = 0; i < n; i++) cnt+=abs(v[i] - sth[i]); return cnt; }
#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...