제출 #301139

#제출 시각아이디문제언어결과실행 시간메모리
301139eagle30Arranging Shoes (IOI19_shoes)C++14
10 / 100
1090 ms8944 KiB
#include "shoes.h" #include<bits/stdc++.h> using namespace std; int mi(vector<int> vi, int d){ int n=vi.size(), mini=2e9; bool is=true; for(int i=0; i<n; i+=2){ if(vi[i]>0 || vi[i+1]<0 || -vi[i]!=vi[i+1]) is=false; } if(is) return d; if(d==8) return 2000000000; for(int i=0; i<n-1; i++){ swap(vi[i], vi[i+1]); mini=min(mini, mi(vi, d+1)); swap(vi[i], vi[i+1]); } return mini; } long long count_swaps(vector<int> s) { int hi=mi(s, 0); if(hi!=2000000000) return mi(s, 0); else return 9; }
#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...