| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1206195 | thelegendary08 | Arranging Shoes (IOI19_shoes) | C++17 | 18 ms | 4284 KiB |
#include "shoes.h"
#include<bits/stdc++.h>
#define int long long
#define f0r(i,n) for(int i = 0; i<n; i++)
#define pb push_back
#define vi vector<int>
using namespace std;
int count_swaps(std::vector<signed> s) {
int n = s.size();
if(n == 2){
if(s[0] < 0)return 0;
else return 1;
}
else{
vi rs;
f0r(i,n){
if(s[i] > 0)rs.pb(i);
}
vi tar;
for(int i = 1; i<n; i+=2){
tar.pb(i);
}
int ans = 0;
f0r(i, rs.size()){
ans += abs(rs[i] - tar[i]);
}
return ans;
}
return 1;
}
| # | 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... | ||||
