제출 #367885

#제출 시각아이디문제언어결과실행 시간메모리
367885ruadhanArranging Shoes (IOI19_shoes)C++14
50 / 100
1082 ms4076 KiB
#include <bits/stdc++.h> typedef long long ll; using namespace std; ll count_swaps(vector<int> S) { ll ans = 0; ll found = 0; for (ll i = 0; i < (int)S.size(); i += 2) { found = find(S.begin() + i, S.end(), -S[i]) - S.begin(); ans += (found - i - (S[i] < 0 ? 1 : 0)); S.insert(S.begin() + i + (S[i] < 0 ? 1 : 0), -S[i]); S.erase(S.begin() + found + 1); } 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...