# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
934404 | thinknoexit | Sails (IOI07_sails) | C++17 | 406 ms | 4724 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;
pair<int, int> a[100100];
int tree[400400], lazy[400400];
ll ans = 0;
void lzy(int now, int l, int r) {
if (lazy[now] == 0) return;
tree[now] += lazy[now];
if (l != r) {
lazy[2 * now] += lazy[now];
lazy[2 * now + 1] += lazy[now];
}
lazy[now] = 0;
}
void update(int ql, int qr, int now = 1, int l = 1, int r = 100000) {
lzy(now, l, r);
if (l > qr || r < ql) return;
if (ql <= l && r <= qr) {
lazy[now]++;
lzy(now, l, r);
return;
}
int mid = (l + r) / 2;
update(ql, qr, 2 * now, l, mid), update(ql, qr, 2 * now + 1, mid + 1, r);
tree[now] = max(tree[2 * now], tree[2 * now + 1]);
}
int query(int v, int now = 1, int l = 1, int r = 100000) {
lzy(now, l, r);
if (l == r) return tree[now];
# | 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... |
# | 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... |