| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1355603 | Charizard2021 | Arranging Shoes (IOI19_shoes) | C++20 | 1095 ms | 3652 KiB |
#include "shoes.h"
#include<bits/stdc++.h>
using namespace std;
long long count_swaps(vector<int> s){
long long n = (long long)s.size()/2;
long long ans = 0;
for(int i = 0; i < n; i++){
int idx = -1;
for(int j = 0; j < (int)s.size(); j++){
if(s[0] == -s[j]){
idx = j;
break;
}
}
if(s[0] < 0){
ans += idx - 1;
}
else{
ans += idx;
}
vector<int> s2;
for(int j = 1; j < (int)s.size(); j++){
if(j != idx){
s2.push_back(s[j]);
}
}
swap(s, s2);
}
return ans;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
