제출 #126183

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

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

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