Submission #293322

#TimeUsernameProblemLanguageResultExecution timeMemory
293322REALITYNBSorting (IOI15_sorting)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std ; int func(int n , int s[] , int m , int x[] , int y[] , int p[] , int q[]){ if(n==1){ p[0]=q[0]=0 ; return 0 ; } if(n==2){ if(s[0]<s[1]) p[0]=0,q[0]=1 ; else p[0]=0,q[0]=0 ; return 0 ; } int pp = 2 ; for(int i=0;i<n;i++){ swap(s[x[i]],s[y[i]]); for(int j=0;j<n;j++){ if(s[j]==pp){ p[i] = j ; q[i]=pp ; break ; } } pp++ ; if(pp==n) break ; } if(s[0]>s[1]) p[pp-2]=q[pp-2]=0 ; else p[pp]=0 , q[pp-2]=1 ; return pp ; }

Compilation message (stderr)

sorting.cpp: In function 'int func(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:3:32: warning: unused parameter 'm' [-Wunused-parameter]
    3 | int func(int n , int s[] , int m , int x[] , int y[] , int p[] , int q[]){
      |                            ~~~~^
/tmp/cc2Boy0m.o: In function `main':
grader.c:(.text.startup+0x4a5): undefined reference to `findSwapPairs(int, int*, int, int*, int*, int*, int*)'
collect2: error: ld returned 1 exit status