# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
291050 | davi_bart | Wall (IOI14_wall) | C++14 | 1124 ms | 33784 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>
#include "wall.h"
using namespace std;
using ll = long long;
#define N 100003
class SegmentTree {
const ll inf = 1e18;
int n, n0;
ll max_v[4*N], smax_v[4*N], max_c[4*N];
ll min_v[4*N], smin_v[4*N], min_c[4*N];
ll sum[4*N];
ll ecnt[4*N], ladd[4*N];
void update_node_max(int k, ll x) {
sum[k] += (x - max_v[k]) * max_c[k];
if(max_v[k] == min_v[k]) {
max_v[k] = min_v[k] = x;
} else if(max_v[k] == smin_v[k]) {
max_v[k] = smin_v[k] = x;
} else {
max_v[k] = x;
}
}
void update_node_min(int k, ll x) {
sum[k] += (x - min_v[k]) * min_c[k];
# | 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... |