| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1400939 | gem123 | Arranging Shoes (IOI19_shoes) | C++20 | 0 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
long long count_swaps(vector<int>S){
long long n=S.size()/2;
long long ans=0;
for(int i=0;i<n*2-1;i+=2){
if(abs(S[i])!=abs(S[i+1])){
for(int j=i+2;j<2*n;j++){
if(abs(S[i])!=abs(S[j])){
swap(S[i],S[j]);
ans++;
}
}
}
}
int i=0;
while(i<2*n-1){
if(S[i]<0&&S[i+1]>0){
i+=2;
}else{
i+=2;
ans++;
}
}
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... | ||||
