# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
997485 | crafticat | Measures (CEOI22_measures) | C++17 | 438 ms | 16060 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 <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll pres = 1e2;
constexpr ll inf = (1e18);
constexpr ll epsilon = 1;
ll d;
using pll = pair<ll, ll>;
set<pll> dat;
ll insert(ll x, ll cAns) {
auto it = dat.upper_bound({x,inf});
it--;
auto [l, rl] = *it;
it++;
auto [r, rr] = *it;
ll beg = cAns, end = inf;
while (end > beg) {
ll mid = beg + (end - beg) / 2;
ll diff = mid - cAns;
ll jump = (rl - diff + d) - x;
jump = max(jump, -mid);
ll prev = x + jump;
if ((rr + diff <= prev + d) || jump > mid) {
beg = mid + 1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |