제출 #1122133

#제출 시각아이디문제언어결과실행 시간메모리
1122133epicci23정렬하기 (IOI15_sorting)C++17
20 / 100
2 ms504 KiB
#include "bits/stdc++.h" #include "sorting.h" #define all(v) v.begin() , v.end() #define sz(a) (int)a.size() using namespace std; int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]){ vector<int> ar(N); for(int i = 0 ; i < N ; i++) ar[i] = S[i]; for(int i = 0; i < N ; i++){ if(is_sorted(all(ar))) return i; for(int j = 0; j < N ; j++){ if(ar[j] == i){ P[i] = j; Q[i] = i; swap(ar[i], ar[j]); break; } } } return N; }

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

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