# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
297236 | A02 | Arranging Shoes (IOI19_shoes) | C++14 | 1063 ms | 5344 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 <bits/stdc++.h>
#include "shoes.h"
using namespace std;
long long count_swaps(vector<int> s) {
int N = s.size();
long long total = 0;
while(s.size()){
int first = s[0];
if (first > 0){
total++;
}
vector<int> s1;
bool found = false;
for (int i = 1; i < s.size(); i++){
if (!found && s[i] + s[0] == 0){
found = true;
total += i - 1;
} else {
s1.push_back(s[i]);
}
}
s = s1;
}
return total;
}
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... |