Submission #94892

#TimeUsernameProblemLanguageResultExecution timeMemory
94892someone_aaSorting (IOI15_sorting)C++17
20 / 100
3 ms512 KiB
#include <bits/stdc++.h> #include "sorting.h" using namespace std; const int maxn = 110; int value[maxn], ind[maxn]; int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { int br = 0; for(int i=0;i<N;i++) { value[i] = S[i]; ind[S[i]] = i; } for(int i=0;i<N;i++) { if(value[i] == i) continue; P[br] = i; Q[br] = ind[i]; ind[value[i]] = ind[i]; value[ind[i]] = value[i]; value[i] = i; ind[i] = i; br++; } return br; }

Compilation message (stderr)

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:7:39: warning: unused parameter 'M' [-Wunused-parameter]
 int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
                                       ^
sorting.cpp:7:48: warning: unused parameter 'X' [-Wunused-parameter]
 int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
                                                ^
sorting.cpp:7:57: warning: unused parameter 'Y' [-Wunused-parameter]
 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...