제출 #1240129

#제출 시각아이디문제언어결과실행 시간메모리
1240129simplemind_31Sorting (IOI15_sorting)C++20
16 / 100
2 ms328 KiB
#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[]){ int now=0; for(int i=N-1;i>=2;i--){ swap(S[X[now]],S[Y[now]]); for(int j=i;j>=0;j--){ if(S[j]==i){ P[now]=i; Q[now]=j; swap(S[i],S[j]); now++; } } } if(X[now]==Y[now]){ if(S[0]!=0){ P[now]=0; Q[now]=1; swap(S[0],S[1]); now++; } }else if(X[now]==0 && Y[now]==1){ if(S[0]!=0){ swap(S[0],S[1]); P[now]=Q[now]=0; now++; } } return now; }
#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...