This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "shoes.h"
using namespace std;
long long x=0;
long long count_swaps(vector<int> s) {
string xd="";
int tam=s.size();
for(int i=0;i<tam;i++){
if(s[i]>0){
xd=xd+"+";
}else{
xd=xd+"-";
}
}
int segura=1;
for(int i=0;i<tam;i++){
if(xd[i*2]=='+'){
for(;xd[segura]=='+';segura+=2){
}
x+=abs(2*i-segura);
}
}
return x;
}
# | 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... |