제출 #347989

#제출 시각아이디문제언어결과실행 시간메모리
347989ChaskaArranging Shoes (IOI19_shoes)C++17
50 / 100
1092 ms1944 KiB
#include "shoes.h" #include <bits/stdc++.h> using namespace std; int n; long long count_swaps(vector<int> s) { n = s.size()/2; long long k=0; for (int i=n+n-1;i>=1;i-=2) { int p = s[i]; int q = p *-1; int w = i-1; while (s[w]!=q) w--; while (w<i) { swap(s[w],s[w+1]); k++; w++; } if (s[i]<0) k--; } return k; }
#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...