Submission #1012291

#TimeUsernameProblemLanguageResultExecution timeMemory
1012291aykhnSorting (IOI15_sorting)C++17
20 / 100
1 ms348 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[]) { for (int R = 0; R <= M; R++) { int f = -1; for (int i = 0; i < N; i++) { if (S[i] != i) { f = i; break; } } if (f == -1) return R; swap(X[R], Y[R]); f = 0; for (int i = 0; i < N; i++) { if (S[i] != i) { f = i; break; } } P[R] = f, Q[R] = S[f]; swap(S[f], S[S[f]]); } assert(0); return -1; }
#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...