This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "gap.h"
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define rt insert
#define st first
#define nd second
#define ll long long
#define pii pair < int , int >
#define DB printf("debug\n");
#define umax( x , y ) x = max( x , (y) )
#define umin( x , y ) x = min( x , (y) )
#define all(x) x.begin() , x.end()
using namespace std;
long long findGap(int T, int N)
{
if(T==1){
long long a[N];memset(a,0,sizeof(a));
int l=0,r=N-1;
while(l<r){
if(l==0 && r==N-1){
MinMax(0,1e18,&a[l],&a[r]);
}
MinMax(a[l-1],a[r+1],&a[l],&a[r]);
l++,r--;
}
long long ans;
for(int i=0;i<N-1;i++){
umax(ans,a[i+1]-a[i]);
}
return ans;
}
else if(T==2){
}
return 0;
}
Compilation message (stderr)
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:31:10: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
return ans;
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |