# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
40858 |
2018-02-09T14:34:34 Z |
IvanC |
Gap (APIO16_gap) |
C++14 |
|
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 ii(ini,ini);
ll copia1 = ini,copia2 = fim;
MinMax(ini,fim,&copia1,&copia2);
ini = copia1;
fim = copia2;
if(fim - ini <= maior) return ii(ini,fim);
ll meio = ini + (fim - ini)/2;
ii novo1 = binary_search(ini,meio);
ii novo2 = binary_search(meio,fim);
if(novo1.second != novo2.first) maior = max(maior, novo2.first - novo1.second);
return ii(ini,fim);
}
ll findGap(ll T,ll N){
TT = T;
NN = N;
ll ini = 0,fim = (ll)1e18;
binary_search(ini,fim);
return maior;
}
Compilation message
/tmp/ccfxpQO8.o: In function `main':
grader.cpp:(.text.startup+0x1ae): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status