Submission #132338

#TimeUsernameProblemLanguageResultExecution timeMemory
132338redaSorting (IOI15_sorting)C++14
Compilation error
0 ms0 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++;} else { q[j]=i; p[j]=v[i].second; c++; j++; i++; } } return c; }

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:56: warning: unused parameter 'Y' [-Wunused-parameter]
 int findSwapPairs(int N, int S[], int M, int X[], int  Y, int p[], int q[])
                                                        ^
/tmp/cc40v4LD.o: In function `main':
grader.c:(.text.startup+0x517): undefined reference to `findSwapPairs(int, int*, int, int*, int*, int*, int*)'
collect2: error: ld returned 1 exit status