Submission #301127

#TimeUsernameProblemLanguageResultExecution timeMemory
301127eagle30Arranging Shoes (IOI19_shoes)C++14
10 / 100
1093 ms10232 KiB
#include "shoes.h" #include<bits/stdc++.h> using namespace std; int mi(vector<int> vi, int d){ if(d==8) return 2000000000; 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; 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) { return mi(s, 0); }
#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...