# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1091281 | owieczka | Gap (APIO16_gap) | C++17 | 48 ms | 3268 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
vector<ll> points;
long long findGap(int T, int N)
{
ll s = 0;
ll t = 1e18;
ll b, e;
ll n = N;
MinMax(s, t, &b, &e);
// musze podzielic na przedziały
ll prz = (e - b)/n + 1;
ll mn, mx;
points.push_back(b);
for (ll i = b + 1; i < e; i+=prz)
{
MinMax(i, i + prz - 1, &mn, &mx);
if (mn != -1)
points.push_back(mn);
if (mx != -1)
points.push_back(mx);
}
points.push_back(e);
mx = 0;
for (ll i = 1; i < points.size(); i++)
{
mx = max(points[i] - points[i-1], mx);
}
return mx;
}
//1000000000000000000
//250'000'000'000'000'001
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |