Submission #795522

#TimeUsernameProblemLanguageResultExecution timeMemory
795522CauchicoSorting (IOI15_sorting)C++14
0 / 100
3 ms340 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 n = N, m = M; for (int i=n;i<m;i++) { P[i] = Q[i] = 0; } for (int i=0;i<n;i++) { for (int j=0;j<n;j++) { if (S[j] == i) { swap(S[j], S[i]); P[i] = i; Q[i] = j; } } } if (Y[0] == 1 and m&1) { Q[m-1] = 1; } return m; }

Compilation message (stderr)

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:5:46: warning: unused parameter 'X' [-Wunused-parameter]
    5 | 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...