Submission #797700

#TimeUsernameProblemLanguageResultExecution timeMemory
797700izanbfArranging Shoes (IOI19_shoes)C++14
50 / 100
1085 ms3028 KiB
#include <bits/stdc++.h> #include "shoes.h" using namespace std; using vi = vector<int>; using ll = long long; ll count_swaps(vi s) { ll cnt = 0; while (not s.empty()) { int i = 1; while (s[i] != -s[0]) { ++i; } cnt += i-1; if (s[0] > 0) ++cnt; s.erase(s.begin() + i); s.erase(s.begin()); } 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...