# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
444333 | parsabahrami | The short shank; Redemption (BOI21_prison) | C++17 | 2089 ms | 204160 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.
/* I do it for the glory */
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<double, int> pii;
#define SZ(x) (int) x.size()
#define F first
#define S second
#define lc id << 1
#define rc lc | 1
const int N = 1e6 + 10, MOD = 1e9 + 7; const double eps = 1e-14;
int R[N], t[N], n, T, D; int seg[N << 2], dp[N][100];
void bld(int x, int id = 1, int l = 1, int r = n + 1) {
if (r - l < 2) { seg[id] = dp[l][x] + l; return; }
int md = (l + r) >> 1;
bld(x, lc, l, md), bld(x, rc, md, r);
seg[id] = min(seg[lc], seg[rc]);
}
int get(int ql, int qr, int id = 1, int l = 1, int r = n + 1) {
if (qr <= l || r <= ql) return MOD;
if (ql <= l && r <= qr) { return seg[id]; }
int md = (l + r) >> 1;
return min(get(ql, qr, lc, l, md), get(ql, qr, rc, md, r));
}
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |