제출 #837866

#제출 시각아이디문제언어결과실행 시간메모리
837866DarkMatterArranging Shoes (IOI19_shoes)C++17
10 / 100
0 ms212 KiB
#include<bits/stdc++.h> #include "shoes.h" using namespace std; long long count_swaps(std::vector<int> v) { int n = v.size(); long long ans = 0; vector<int>l, r, idx(n / 2); for (int i = 0; i < n; i++) v[i] > 0 ? r.push_back(i) : l.push_back(i); for (int i = 0; i < n / 2; i++) { int dif = abs(l[i] - r[i]) - 1; ans += dif; if (l[i] > r[i]) ans++; } return ans; }
#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...