Submission #1084123

#TimeUsernameProblemLanguageResultExecution timeMemory
1084123Ibrohim0704Gap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n,k; vector<int> a(k); for(int i=0;i<k;i++){ cin>>a[i]; } int ans=0; for(int i=1;i<n;i++){ ans=max(ans,a[i]-a[i-1]); } cout<<ans; }

Compilation message (stderr)

gap.cpp: In function 'int main()':
gap.cpp:6:20: warning: 'k' is used uninitialized in this function [-Wuninitialized]
    6 |     vector<int> a(k);
      |                    ^
gap.cpp:5:9: warning: 'n' may be used uninitialized in this function [-Wmaybe-uninitialized]
    5 |     int n,k;
      |         ^
/usr/bin/ld: /tmp/ccu6k3LK.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccVSZdrL.o:gap.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccu6k3LK.o: in function `main':
grader.cpp:(.text.startup+0x1b7): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status