제출 #1063986

#제출 시각아이디문제언어결과실행 시간메모리
1063986jamjanekArranging Shoes (IOI19_shoes)C++14
50 / 100
1097 ms3260 KiB
#include "shoes.h" #include<bits/stdc++.h> using namespace std; long long count_swaps(std::vector<int> s) { // int n = s.size()/2; long long wynik = 0; while(s.size()){ //printf("%d %d\n", s.size(), wynik); int szukaj = -s[0]; for(int i=0;i<(int)s.size();i++){ if(s[i]==szukaj){ szukaj = i; break; } } if(s[0]>0)wynik++; wynik+=szukaj-1; s.erase(s.begin()+szukaj, s.begin()+szukaj+1); s.erase(s.begin(), s.begin()+1); } return wynik; }
#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...