제출 #287480

#제출 시각아이디문제언어결과실행 시간메모리
287480AaronNaidu정렬하기 (IOI15_sorting)C++14
0 / 100
3 ms384 KiB
#include <bits/stdc++.h> //#include "sorting.h" using namespace std; vector<int> s; int n; bool sorted() { for (int i = 0; i < n; i++) { if (s[i] != i) { return false; } } return true; } int findSwapPairs(int N,int S[],int M, int X[],int Y[], int P[],int Q[]) { for (int i = 0; i < M; i++) { P[i] = 0; Q[i] = 0; } n = N; for (int i = 0; i < N; i++) { s.push_back(S[i]); } for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (S[j] == i) { P[i] = i; Q[i] = j; swap(s[j], s[i]); swap(S[j], S[i]); break; } } } return N; }

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

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