Submission #40863

# Submission time Handle Problem Language Result Execution time Memory
40863 2018-02-09T14:57:51 Z IvanC Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
ll NN,TT,maior;
ii binary_search(ll ini,ll fim){
	if(ini == fim) return;
	ll copia1,copia2;
	ll meio = ini + (fim - ini)/2;
	MinMax(meio+1,meio,&copia1,&copia2);
	maior = max(maior, abs(copia1 - copia2) );
	if(fim - ini <= maior) return;
	binary_search(ini,copia2);
	binary_search(copia1,fim);
	return;
}
ll findGap(int T,int N){
	TT = T;
	NN = N;
	ll ini = 0,fim = (ll)1e18,copia1,copia2;
	MinMax(ini,fim,&copia1,&copia2);
	binary_search(copia1,copia2);
	return maior;
}

Compilation message

gap.cpp: In function 'ii binary_search(ll, ll)':
gap.cpp:8:17: error: return-statement with no value, in function returning 'ii {aka std::pair<long long int, long long int>}' [-fpermissive]
  if(ini == fim) return;
                 ^
gap.cpp:13:25: error: return-statement with no value, in function returning 'ii {aka std::pair<long long int, long long int>}' [-fpermissive]
  if(fim - ini <= maior) return;
                         ^
gap.cpp:16:2: error: return-statement with no value, in function returning 'ii {aka std::pair<long long int, long long int>}' [-fpermissive]
  return;
  ^