# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
826916 | tomruk | Comparing Plants (IOI20_plants) | C++17 | 278 ms | 18144 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 "plants.h"
#include <bits/stdc++.h>
#define N 200005
using namespace std;
struct SegTree{
vector<pair<int,int>> t;
vector<int> lazy;
int n;
SegTree(int sz,vector<int> a){
n = sz;
t.assign(4*n,{0,0});
lazy.assign(4*n,0);
build(1,0,n-1,a);
}
void build(int v,int tl,int tr,vector<int> &a){
if(tl == tr){
t[v] = {a[tl],tl};
return;
}
int tm = (tl + tr)/2;
build(v*2,tl,tm,a);
build(v*2 + 1,tm+1,tr,a);
t[v] = t[v*2];
if(t[v*2 + 1].first < t[v].first)
t[v] = t[v*2+1];
}
void push(int v){
t[v*2].first += lazy[v];
lazy[v*2] += lazy[v];
t[v*2 + 1].first += lazy[v];
# | 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... |