# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
160541 | FiloSanza | Sorting (IOI15_sorting) | C++14 | 13 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 "sorting.h"
#include <bits/stdc++.h>
using namespace std;
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
swap(S[X[0]], S[Y[0]]);
int cont = 0;
for(int i=0; i<N; i++){
int idx = min_element(S, S+N) - S;
swap(S[i], S[idx]);
P[cont] = i;
Q[cont++] = idx;
swap(S[X[i]], S[Y[i]]);
}
if(S[0] > S[1]){
P[cont] = 0;
Q[cont++] = 1;
}
return cont;
}
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... |