제출 #965369

#제출 시각아이디문제언어결과실행 시간메모리
965369akacool445kArranging Shoes (IOI19_shoes)C++14
10 / 100
2 ms420 KiB
#include "shoes.h" using namespace std; long long count_swaps(vector<int> s) { long long n = s.size(); long long ans = 0; vector<int> c(n, 1); for (int i = 0; i < n; i++) { if (c[i] == 0) continue; int ss = 0; for (int j = i + 1; j < n; j++) { if (s[i] + s[j] == 0) { ans += ss; c[j] = 0; break; } else { ss += c[j]; } } if (s[i] > 0) 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...