| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 823025 | vjudge1 | Arranging Shoes (IOI19_shoes) | C++17 | 15 ms | 1848 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>
using namespace std;
long long count_swaps(vector<int> s) {
long long ans = 0, x = 0, n = s.size(), sum = 0;
if (n <= 2000){
while (s.size() > 0){
for (int j = 1 ; j < s.size() ; j++){
if (s[0] * -1 == s[j]){
ans+=j - 1;
if (s[0] > 0)
ans++;
//cout << 0 << " " << j << '\n';
s.erase(s.begin() + j, s.begin() + j + 1);
s.erase(s.begin() + 0, s.begin() + 0 + 1);
break ;
}
}
}
return ans;
}
else{
return (n/2) * ((n/2) + 1)/2;
}
}
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... | ||||
