# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
65678 | mirbek01 | Sorting (IOI15_sorting) | C++17 | 6 ms | 384 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 = 0; i < n; i++)
{
bool fl = true;
for (int j = 0; j < n; j++)
if (ar[j] != j)
fl = false;
if (fl) break;
for (int j = i; j < n; j++)
{
if ( ar[j] == i )
{
swap(ar[j], ar[i]);
p[sz] = i;
q[sz] = j;
sz++;
break;
}
}
}
for(int i = 0; i < n; i ++){
assert(i == ar[i]);
}
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... |