Submission #1122124

#TimeUsernameProblemLanguageResultExecution timeMemory
1122124epicci23Sorting (IOI15_sorting)C++17
0 / 100
2 ms444 KiB
#include "sorting.h" #include "bits/stdc++.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[]) { for(int i = N - 1; i >= 0 ; i--){ for(int j = 0; j < N ; j++){ if(S[j] == i){ P[N - 1 - i] = j; Q[N - 1 - i] = i; swap(S[i], S[j]); break; } } } return N; }

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