Submission #474105

#TimeUsernameProblemLanguageResultExecution timeMemory
474105ValiAntonieArranging Shoes (IOI19_shoes)C++14
0 / 100
0 ms204 KiB
#include "shoes.h" #include<bits/stdc++.h> using namespace std; long long count_swaps(vector<int> v){ int indice = 0; int i = 0, nr = 0, numar = 0, j = 0, j2 = 0; int n = v.size(); for(i=indice;i<=n;i++){ if(v[i] < 0){ indice++; numar = -v[i]; for(j=i;j>indice;j--){ swap(v[j],v[j-1]); nr++; } indice++; for(j2=1;j2<=n;j2++){ if(v[j2] == numar){ for(j=i;j>indice;j--){ swap(v[j],v[j-1]); nr++; } } } i = indice; } } return nr; }
#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...