# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
303649 | myungwoo | Comparing Plants (IOI20_plants) | C++11 | 1529 ms | 17752 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 "plants.h"
using namespace std;
#define MAXN 200005
#define debug(...) fprintf(stderr, __VA_ARGS__); fflush(stderr);
const int TS = 1<<20, ST = TS/2-1;
int N, K, R[MAXN*2];
int A[MAXN*2], B[MAXN*2];
struct SegTree{
template <typename T>
struct Value{
T value, lazysum;
};
Value<int> tree[TS];
void build(int arr[]){
memset(tree, 0, sizeof(tree));
for (int i=ST+1;i<TS;i++) tree[i].value = i-ST <= N+N ? arr[i-ST] : 1e9;
for (int i=ST;i;i--) tree[i].value = min(tree[i*2].value, tree[i*2+1].value);
}
void propagate(int n){
if (n <= ST){
tree[n*2].value += tree[n].lazysum, tree[n*2+1].value += tree[n].lazysum;
tree[n*2].lazysum += tree[n].lazysum, tree[n*2+1].lazysum += tree[n].lazysum;
}
tree[n].lazysum = 0;
}
void update(int n, int s, int e, int l, int r, const int &v){
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |