제출 #480680

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