# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
434590 | ismoilov | Sorting (IOI15_sorting) | C++17 | 1089 ms | 332 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 check(int a[], int n){
for(int i = 0; i < n; i ++)
if(a[i] != i)
return i;
return -1;
}
int findSwapPairs(int n, int s[], int m, int x[], int y[], int p[], int q[]) {
int i = check(s, n);
while(i != -1){
swap(s[x[i]], s[y[i]]);
for(int j = 0; j < n; j ++){
if(s[j] == i){
swap(s[j], s[i]);
p[i] = i, q[i] = j;
}
}
i = check(s, n);
}
return n;
}
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... |