#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
long long findGap (int tip , int cantitate)
{
long long *inceput = new long long , *sfarsit = new long long;
MinMax(0 , 1e18 , inceput , sfarsit);
const long long lungime_bloc = (*sfarsit - *inceput - 1) / (cantitate - 1) + 1;
long long maxim = lungime_bloc;
for (long long capat = *inceput , anterior = -1 ; capat < *sfarsit ; capat += lungime_bloc)
{
long long *__inceput = new long long , *__sfarsit = new long long;
MinMax(capat , capat + lungime_bloc - 1 , __inceput , __sfarsit);
if (anterior != -1 && *__inceput != -1) { maxim = max(maxim , *__inceput - anterior); }
if (*__sfarsit != -1) { anterior = *__sfarsit; }
delete __inceput;
delete __sfarsit;
}
return maxim;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |