#include "shoes.h"
#include <bits/stdc++.h>
using namespace std;
long long count_swaps(std::vector<int> s) {
	long long ans = 0;
	for(int i = 0; i < s.size(); i++){
		if(s[i] < 0){
			int pos = -1;
			for(int j = i + 1; j < s.size(); j++){
				if(s[j] == -s[i]){
					pos = j;
					break;
				}
			}
			
			while(pos > i + 1){
				swap(s[pos], s[pos - 1]);
				pos--;
				ans++;
			}
			
			i++;
		} else if(s[i] > 0){
			int pos = -1;
			for(int j = i + 1; j < s.size(); j++){
				if(s[j] == -s[i]){
					pos = j;
					break;
				}
			}
			
			while(pos > i){
				swap(s[pos], s[pos - 1]);
				pos--;
				ans++;
			}
		}
	}
	
	return ans;
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |