Submission #419603

#TimeUsernameProblemLanguageResultExecution timeMemory
419603AugustinasJucasSorting (IOI15_sorting)C++14
Compilation error
0 ms0 KiB
#include "sorting.h" int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { P[0] = 0; Q[0] = 0; for(int i = 0; i < N; i++){ // pastatysiu i i jo vieta int kur = 0; for(int j = 0; j < N; j++) if(S[j] == i) kur = j; swap(S[i], S[kur]); P[i] = i; Q[i] = kur; } return N; }

Compilation message (stderr)

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:11:9: error: 'swap' was not declared in this scope
   11 |         swap(S[i], S[kur]);
      |         ^~~~
sorting.cpp:3:39: warning: unused parameter 'M' [-Wunused-parameter]
    3 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                   ~~~~^
sorting.cpp:3:46: warning: unused parameter 'X' [-Wunused-parameter]
    3 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                          ~~~~^~~
sorting.cpp:3:55: warning: unused parameter 'Y' [-Wunused-parameter]
    3 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                                   ~~~~^~~