| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1323954 | aritro_ | Arranging Shoes (IOI19_shoes) | C++20 | 1095 ms | 1948 KiB |
//#include "shoes.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
ll count_swaps(std::vector<int> a){
int n=a.size();
ll l=0,r=0;
ll ans=0;
while(l<n){
r++;
int k=-1*a[l];
if(k==a[r]){
ans+=r-l-1;
for(int i=r;i>l+1;i--) swap(a[i],a[i-1]);
if(a[l]>0){
ans++;
swap(a[l],a[l+1]);
}
l+=2;
r=l;
}
}
return ans;
}| # | 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... | ||||
