Submission #1015093

# Submission time Handle Problem Language Result Execution time Memory
1015093 2024-07-06T05:21:23 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;
		lim2=--mx;
	}
	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:20: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   13 |   MinMax(lim1,lim2,mn,mx);
      |                    ^~
      |                    |
      |                    long long int
In file included from gap.cpp:1:
gap.h:1:35: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                   ^~~~~~~~~~
gap.cpp:13:23: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   13 |   MinMax(lim1,lim2,mn,mx);
      |                       ^~
      |                       |
      |                       long long int
In file included from gap.cpp:1:
gap.h:1:47: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                               ^~~~~~~~~~