Submission #1012289

#TimeUsernameProblemLanguageResultExecution timeMemory
1012289aykhnSorting (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; P[R] = f, Q[R] = S[f]; swap(S[f], S[S[f]]); } assert(0); return -1; }

Compilation message (stderr)

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:6:46: warning: unused parameter 'X' [-Wunused-parameter]
    6 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[])
      |                                          ~~~~^~~
sorting.cpp:6:55: warning: unused parameter 'Y' [-Wunused-parameter]
    6 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[])
      |                                                   ~~~~^~~
#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...