# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
287480 | AaronNaidu | Sorting (IOI15_sorting) | C++14 | 3 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 <bits/stdc++.h>
//#include "sorting.h"
using namespace std;
vector<int> s;
int n;
bool sorted() {
for (int i = 0; i < n; i++)
{
if (s[i] != i)
{
return false;
}
}
return true;
}
int findSwapPairs(int N,int S[],int M, int X[],int Y[], int P[],int Q[]) {
for (int i = 0; i < M; i++)
{
P[i] = 0;
Q[i] = 0;
}
n = N;
for (int i = 0; i < N; i++)
{
s.push_back(S[i]);
}
for (int i = 0; i < N; i++)
{
for (int j = 0; j < N; j++)
{
if (S[j] == i)
{
P[i] = i;
Q[i] = j;
swap(s[j], s[i]);
swap(S[j], S[i]);
break;
}
}
}
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... |