제출 #240823

#제출 시각아이디문제언어결과실행 시간메모리
240823zoomswkArranging Shoes (IOI19_shoes)C++17
50 / 100
1091 ms3192 KiB
#include "shoes.h" using namespace std; long long count_swaps(std::vector<int> s) { int n = (int)s.size(); long long res = 0; for(int i=0; i<n; i+=2){ int loc = -1; for(int j=i+1; j<n; j++) if(s[j] == -s[i]){ loc = j; break; } while(loc > i+1){ swap(s[loc], s[loc-1]); loc--; res++; } if(s[i] > 0) res++; } return res; }
#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...