제출 #132341

#제출 시각아이디문제언어결과실행 시간메모리
132341reda정렬하기 (IOI15_sorting)C++14
0 / 100
2 ms376 KiB
#include<bits/stdc++.h> using namespace std ; # include "sorting.h" vector<pair<int,int>> v; int findSwapPairs(int N, int S[], int M, int X[], int Y[], int p[], int q[]) { for(int i=0;i<N;i++) { v.push_back(make_pair(S[i],i)); } int c=0; sort(v.begin(),v.end()); int i=0,j=0; while(i<N) { if(v[i].first != S[i]){i++;p[j]=0;q[j]=0;} else { q[j]=i; p[j]=v[i].second; c++; j++; i++; } } return c; }

컴파일 시 표준 에러 (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[])
                                                ^
sorting.cpp:5:58: 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...