Submission #287480

#TimeUsernameProblemLanguageResultExecution timeMemory
287480AaronNaiduSorting (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; }

Compilation message (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...