Submission #1326474

#TimeUsernameProblemLanguageResultExecution timeMemory
1326474SSKMFGap (APIO16_gap)C++20
0 / 100
48 ms1204 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...