Submission #601773

#TimeUsernameProblemLanguageResultExecution timeMemory
601773Minindu2006Arranging Shoes (IOI19_shoes)C++14
45 / 100
31 ms3792 KiB
#include "shoes.h" #include<bits/stdc++.h> using namespace std; #define ll long long long long count_swaps(std::vector<int> s) { int n = s.size() / 2; vector<int> l; for (int i = 0; i < 2 * n; i++) if (s[i] < 0) l.push_back(i); ll ans = 0, j = 0; for (int i = 0; i < 2 * n; i += 2) ans += abs(i - l[j]), j++; 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...