Submission #74060

#TimeUsernameProblemLanguageResultExecution timeMemory
74060aleksamSorting (IOI15_sorting)C++14
0 / 100
6 ms384 KiB
#include <bits/stdc++.h> #include "sorting.h" using namespace std; /*int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { int nula=S[0]; int kec=S[1]; } */ int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { for(int i=0; i<N; ++i){ int ind=-1; for(int j=0; j<N; ++j){ if(S[j]==i){ ind=j; //printf("S[%d]=%d\n", j, S[j]); } } assert(ind!=-1); P[i]=i; Q[i]=ind; //printf("ind=%d\n", ind); int t=S[i]; S[i]=S[ind]; S[ind]=t; } for(int i=0; i<N; ++i)assert(S[i]==i); return N; }

Compilation message (stderr)

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:11: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:11: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:11: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...