Submission #162060

#TimeUsernameProblemLanguageResultExecution timeMemory
162060impriGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include"gap.h" using namespace std; long long res[100001]; long long findGap(int T,long long N){ long long mi,ma; long long *mn,*mx; *mn=mi; *mx=ma; MinMax(1,10e18,mn,mx); res[1]=mi; res[N]=ma; int curmi=2; int curma=N-1; while(1){ if(curmi>curma)break; MinMax(res[curmi-1]+1,res[curma+1]-1,mn,mx); res[curmi]=mi; res[curma]=ma; curmi++; curma--; } long long r=2LL*10e18; for(int i=1;i<N-1;i++){ r=min(r,res[i+1]-res[i]); } return r; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, long long int)':
gap.cpp:10:21: warning: overflow in implicit constant conversion [-Woverflow]
 MinMax(1,10e18,mn,mx);
                     ^
gap.cpp:23:16: warning: overflow in implicit constant conversion [-Woverflow]
 long long r=2LL*10e18;
             ~~~^~~~~~
gap.cpp:8:4: warning: 'mn' is used uninitialized in this function [-Wuninitialized]
 *mn=mi;
 ~~~^~~
gap.cpp:8:4: warning: 'mi' is used uninitialized in this function [-Wuninitialized]
gap.cpp:9:4: warning: 'mx' is used uninitialized in this function [-Wuninitialized]
 *mx=ma;
 ~~~^~~
gap.cpp:9:4: warning: 'ma' is used uninitialized in this function [-Wuninitialized]
/tmp/cceNOipU.o: In function `main':
grader.cpp:(.text.startup+0x18e): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status