# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
900720 | ozner77 | Arranging Shoes (IOI19_shoes) | C++17 | 1 ms | 348 KiB |
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 "shoes.h"
#include <bits/stdc++.h>
#include <vector>1
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long count_swaps(vector<int> s) {
long long swaps=0;
vector<int> a;
vector<int> b;
int e=s.size();
for(int i=0;i<e;i++){
if(s[i]<0 && i%2==0){
continue;
}else if(s[i]<0){
b.push_back(i);
}else{
a.push_back(i);
}
}
int xd=a.size();
for(int j=0;j<xd;j++){
swaps+=(b[j]-a[j]);
}
return swaps;
}
Compilation message (stderr)
# | 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... |