Submission #126200

#TimeUsernameProblemLanguageResultExecution timeMemory
126200SOIVIEONESorting (IOI15_sorting)C++14
0 / 100
5 ms504 KiB
#include "sorting.h" #include <bits/stdc++.h> using namespace std; int id[2222222]; int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { for(int i = 0; i < N; i ++) id[S[i]] = i; int ans = 0; for(int i = 0; i < N; i ++) { ans = i; int flag = 0; for(int j = 1; j < N; j ++) if(S[j] < S[j - 1]) flag = 1; if(!flag) break; swap(S[id[i]], S[i]); P[i] = id[i]; Q[i] = i; id[S[id[i]]] = id[i]; id[i] = i; ans = i+1; } return ans; }

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