제출 #145087

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