# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1122133 | epicci23 | Sorting (IOI15_sorting) | C++17 | 2 ms | 504 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"
#define all(v) v.begin() , v.end()
#define sz(a) (int)a.size()
using namespace std;
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]){
vector<int> ar(N);
for(int i = 0 ; i < N ; i++) ar[i] = S[i];
for(int i = 0; i < N ; i++){
if(is_sorted(all(ar))) return i;
for(int j = 0; j < N ; j++){
if(ar[j] == i){
P[i] = j;
Q[i] = i;
swap(ar[i], ar[j]);
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... |