Submission #1196003

#TimeUsernameProblemLanguageResultExecution timeMemory
1196003hackstarGap (APIO16_gap)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;

#define int long long

int findGap(int t,int n){
	vector<int>a(n);
	int l=0,r=1e18;
	int mn,mx;
	for(int i=0;i<n/2;i++){
		MinMax(l,r,&mn,&mx);
		a[i]=l;
		a[n-i-1]=r;
		l=mn;
		r=mx;
	}
	int mx=0;
	for(int i=0;i<n-1;i++){
		int cur=a[i+1]-a[i];
		mx=max(mx,cur);
	}
	return mx;
}

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:11:17: error: 'MinMax' was not declared in this scope
   11 |                 MinMax(l,r,&mn,&mx);
      |                 ^~~~~~
gap.cpp:17:13: error: redeclaration of 'long long int mx'
   17 |         int mx=0;
      |             ^~
gap.cpp:9:16: note: 'long long int mx' previously declared here
    9 |         int mn,mx;
      |                ^~