# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
636038 | Bruteforceman | Sorting (IOI15_sorting) | C++11 | 5 ms | 452 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;
const int N=2e5+100;
int a[N];
pair<int,int> b[N];
int n;
int num=0;
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
num=0;
n=N;
for(int i=0;i<N;i++){
a[i]=S[i];
b[i]={a[i],i};
}
sort(b,b+n);
for(int i=0;i<n;i++){
a[b[i].second]=i;
}
if(n==1)return num;
if(Y[0]==1)
swap(a[0],a[1]);
for(int i=0;i<n;i++){
int f=0;
for(int j=i+1;j<n;j++){
if(a[j]==i){
P[num]=i;
Q[num]=j;
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... |