제출 #211064

#제출 시각아이디문제언어결과실행 시간메모리
211064lyhArranging Shoes (IOI19_shoes)C++14
0 / 100
5 ms384 KiB
#include "shoes.h" #include <bits/stdc++.h> using namespace std; long long count_swaps(vector<int> S) { long long sum= 0; for(int i= 0; i < (int)S.size(); i+= 2) { int k; for(k= i; k < (int)S.size(); k++) { if(S[k] > 0) break; } for(int j= k; j > i; j--) { swap(S[j], S[j - 1]); sum++; } for(k= i + 1; k < (int)S.size(); k++) { if(S[k] == -S[i]) { break; } } for(int j= k; j > i + 1; j--) { swap(S[j], S[j - 1]); sum++; } } return sum; }
#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...