| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 161631 | kostia244 | Gap (APIO16_gap) | C++14 | 88 ms | 3636 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>
#define pb push_back
using namespace std;
using ll = long long;
long long findGap(int T, int N)
{
ll l = 0, r = 1e18, mn, mx, tl, tr;
MinMax(l, r, &mn, &mx);
ll step = (mx-mn+N-1)/N;
l = 0, r = step;
ll ans = 0;
vector<ll> x;
while(true) {
MinMax(l, r, &tl, &tr);
x.pb(tl);
x.pb(tr);
if(r==mx)break;
l+=step;
r+=step;
r = min(r, mx);
}
for(int i = 1; i < x.size(); i++)
ans = max(ans, x[i]-x[i-1]);
return ans;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
