Submission #1015095

# Submission time Handle Problem Language Result Execution time Memory
1015095 2024-07-06T05:22:24 Z vjudge1 Gap (APIO16_gap) C++17
Compilation error
0 ms 0 KB
#include "gap.h"
#include <bits/stdc++.h>

using namespace std;

#define int long long

int findGap(int t,int n)
{
	int a[n],i=0,j=n-1,*mn,*mx,lim1=0,lim2=1e18;
	while (i<=j)
	{
		MinMax(lim1,lim2,mn,mx);
		a[i++]=*mn;
		a[j--]=*mx;
		lim1=*mn+1;
		lim2=*mx+1;
	}
	int ans=0;
	for (int i=0;i<n-1;i++)
		ans=max(ans,a[i+1]-a[i]);
	
	return ans;
}

Compilation message

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:13:9: warning: 'mn' may be used uninitialized in this function [-Wmaybe-uninitialized]
   13 |   MinMax(lim1,lim2,mn,mx);
      |   ~~~~~~^~~~~~~~~~~~~~~~~
gap.cpp:13:9: warning: 'mx' may be used uninitialized in this function [-Wmaybe-uninitialized]
/usr/bin/ld: /tmp/ccRdQ3CD.o: in function `main':
grader.cpp:(.text.startup+0x1b7): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status