제출 #830484

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