Submission #1076719

#TimeUsernameProblemLanguageResultExecution timeMemory
1076719LCJLYSorting (IOI15_sorting)C++14
0 / 100
1 ms600 KiB
#include "sorting.h" #include <bits/stdc++.h> //#include "grader.cpp" using namespace std; #define show(x,y) cout << y << " " << #x << endl; #define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl; #define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << #i << " " << q << " " << #p << endl; #define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl; int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { int arr[N]; int pos[N]; for(int x=0;x<N;x++){ arr[x]=x; pos[arr[x]]=x; } for(int x=0;x<M;x++){ swap(arr[pos[X[x]]],arr[pos[Y[x]]]); swap(pos[X[x]],pos[Y[x]]); } for(int x=0;x<M;x++){ P[x]=arr[x]; Q[x]=S[x]; } return M; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...