Submission #953929

# Submission time Handle Problem Language Result Execution time Memory
953929 2024-03-26T22:21:12 Z 4QT0R Gap (APIO16_gap) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
#define ll long long

ll findGap(int T, int n){
	ll L,P;
	MinMax(0,1e18,&L,&P);
	ll d=(P-L)/(n-1);
	ll ans=0,x,y;
	while(true){
		MinMax(L+1,P-1,&x,&y);
		if (x==-1){
			ans=max(ans,P-L);
			return;
		}
		else ans=max({ans,x-L,P-y});
		L=x;
		P=y;
	}
	return ans;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:15:4: error: return-statement with no value, in function returning 'long long int' [-fpermissive]
   15 |    return;
      |    ^~~~~~
gap.cpp:9:5: warning: unused variable 'd' [-Wunused-variable]
    9 |  ll d=(P-L)/(n-1);
      |     ^