제출 #40877

#제출 시각아이디문제언어결과실행 시간메모리
40877IvanCGap (APIO16_gap)C++14
0 / 100
97 ms1516 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> ii; const ll MINV = 0; const ll MAXV = (ll)1e18; ll NN,TT,maior; ll findGap(int T,int N){ TT = T; NN = N; ll ini,fim; MinMax(MINV,MAXV,&ini,&fim); ll gap = (ll)ceil(double(fim - ini)/double(N)); vector<ll> diferencas; for(ll i = 0;i<N;i++){ ll lo = ini + i*gap; ll hi = min(lo+gap,fim); if(i != 0) lo++; ll copia1,copia2; MinMax(lo,hi,&copia1,&copia2); maior = max(copia2 - copia1,maior); } return maior; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...