Submission #145384

#TimeUsernameProblemLanguageResultExecution timeMemory
145384Eae02Arranging Shoes (IOI19_shoes)C++17
50 / 100
1080 ms9496 KiB
#include "shoes.h" #include <bits/stdc++.h> using ll = long long; using namespace std; ll count_swaps(vector<int> s) { list<int> sl(s.begin(), s.end()); ll swaps = 0; for (auto it = sl.begin(); it != sl.end(); ++it) { int v = *it; auto b = next(it); while (*b != -v) { swaps++; ++b; } if (v > 0) swaps++; sl.erase(b); } return swaps; }
#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...