# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
917034 | NK_ | Tenis (COI19_tenis) | C++17 | 245 ms | 9168 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.
// Success consists of going from failure to failure without loss of enthusiasm
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
template<class T> using V = vector<T>;
using vi = V<int>;
struct Seg {
const int ID = 0; int comb(int a, int b) { return min(a, b); }
vi seg, lazy; int N; void init(int n) {
for(N = 1; N < n;) N *= 2;
seg.assign(2 * N, ID); lazy.assign(2 * N, ID);
}
void push(int x, int L, int R) {
seg[x] += lazy[x];
if (L != R) for(int i = 0; i < 2; i++) lazy[2*x+i] += lazy[x];
lazy[x] = 0;
}
void pull(int x) { seg[x] = comb(seg[2*x], seg[2*x+1]); }
void upd(int l, int v, int x, int L, int R) { // the suffix starting at l
push(x, L, R); if (R < l) return;
// cout << L << " <-> " << R << endl;
if (l <= L) { lazy[x] += v; push(x, L, R); return; }
int M = (L + R) / 2; upd(l, v, 2 * x, L, M); upd(l, v, 2 * x + 1, M + 1, R);
# | 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... |