제출 #65651

#제출 시각아이디문제언어결과실행 시간메모리
65651mirbek01정렬하기 (IOI15_sorting)C++17
0 / 100
5 ms640 KiB
#include "sorting.h" # include <bits/stdc++.h> using namespace std; int pos[1000]; int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { for(int i = 0; i < N; i ++) pos[S[i]] = i; int sz = 0; for(int i = N - 1; i > 0; i --){ bool fl = 1; for(int j = 0; j < N; j ++){ if(j != S[j]) fl = 0; } if(fl) break; swap(S[X[sz]], S[Y[sz]]); pos[S[X[sz]]] = X[sz]; pos[S[Y[sz]]] = Y[sz]; P[sz] = pos[i], Q[sz] = i; swap(S[i], S[pos[i]]); pos[ S[pos[i]] ] = pos[i]; sz ++; } return sz; }

컴파일 시 표준 에러 (stderr) 메시지

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:9:39: warning: unused parameter 'M' [-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...