# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
65853 | mirbek01 | Sorting (IOI15_sorting) | C++17 | 5 ms | 428 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 "sorting.h"
# include <bits/stdc++.h>
using namespace std;
int findSwapPairs(int n, int ar[], int m, int x[], int y[], int p[], int q[])
{
int sz = 0;
for (int i = n - 1; i >= 0; i --){
bool fl = 1;
for(int j = 0; j < n; j ++){
if(ar[j] != j) fl = 0;
}
if(fl) break;
swap(ar[0], ar[1]);
for (int j = i - 1; j >= 0; j --){
if ( ar[j] == i ){
swap(ar[j], ar[i]);
p[sz] = i;
q[sz] = j;
sz++;
break;
}
}
}
return sz;
}
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... |