# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
388986 | David_M | Gap (APIO16_gap) | C++14 | 64 ms | 1212 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll INF=1e18;
ll findGap(int T, int N){
ll mn, mx;
MinMax(0, INF, &mn, &mx);
if(N==2)return mx-mn;
ll l=mn, r=mx, ans=(mx-mn+1)/((ll)N)+1, Ans=0, MX=mn;
for (ll i=0; i<N; i++)
MinMax(l+1+i*ans, l+(i+1)*ans, &mn, &mx),
Ans=max(Ans, mn-MX),
MX=max(MX, mx);
return Ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |