Submission #134433

#TimeUsernameProblemLanguageResultExecution timeMemory
134433thanospopa (BOI18_popa)C++14
Compilation error
0 ms0 KiB
#include<iostream> #include<popa.h> using namespace std; int myway(int l,int r,int* Left,int* Right){ if(l>r) return -1; if(l==r){ Left[l]=-1; Right[l]=-1; return l; } int g=-1; for(int i=l; i<=r; i++){ if(query(l,i-1,i+1,r)){ Left[i]=myway(l,i-1); Right[i]=myway(i+1,r); break; } } return g; } int solve(int N,int* Left,int* Right){ for(int i=0; i<N; i++){ if(query(0,i-1,i+1,N-1)){ cout<<i; break; } } myway(0,N,Left,Right); }

Compilation message (stderr)

popa.cpp: In function 'int myway(int, int, int*, int*)':
popa.cpp:14:26: error: too few arguments to function 'int myway(int, int, int*, int*)'
       Left[i]=myway(l,i-1);
                          ^
popa.cpp:4:5: note: declared here
 int myway(int l,int r,int* Left,int* Right){
     ^~~~~
popa.cpp:15:27: error: too few arguments to function 'int myway(int, int, int*, int*)'
       Right[i]=myway(i+1,r);
                           ^
popa.cpp:4:5: note: declared here
 int myway(int l,int r,int* Left,int* Right){
     ^~~~~
popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:29:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^