Submission #921731

#TimeUsernameProblemLanguageResultExecution timeMemory
921731coding_snorlaxSorting (IOI15_sorting)C++14
20 / 100
3 ms600 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 i=0;i<N;i++){ for(int j=0;j<N;j++){ if(S[j]==i){ P[i]=j; Q[i]=i; S[j]=S[i]; S[i]=i; break; } } // check already_sorted int flag = 1; for(int j=0;j<N;j++){ if(S[j]!=j) flag =0; } if(flag){ return i+1; } } return N; }

Compilation message (stderr)

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