Submission #709283

#TimeUsernameProblemLanguageResultExecution timeMemory
709283groshiGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include<iostream> #include "gap.h" #define int long long using namespace std; long long a[200000]; /*void MinMax(long long x,long long y,int *l,int *r) { cout<<x<<" "<<y<<"\n"; cin>>*l>>*r; }*/ long long findGap(int t,int n) { if(t==1) { int l,r; MinMax(0,(long long)1e18,&l,&r); a[1]=l; a[n]=r; int pocz=2,kon=n-1; while(pocz<=kon) { MinMax(a[pocz-1]+1,a[kon+1]-1,&l,&r); a[pocz]=l; a[kon]=r; pocz++; kon--; } long long wynik=0; for(int i=1;i<n;i++) wynik=max(wynik,a[i+1]-a[i]); return wynik; } else{ } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
/usr/bin/ld: /tmp/ccHjfyKZ.o: in function `main':
grader.cpp:(.text.startup+0x1b7): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status