# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433625 | arayi | Comparing Plants (IOI20_plants) | C++17 | 1103 ms | 17852 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 <vector>
#include <iostream>
#define ad push_back
using namespace std;
const int N = 1e6 + 30;
int n, k;
int a[N];
int t1[4*N], flg1[4*N];
void push1(int nd)
{
flg1[nd*2]+=flg1[nd];
flg1[nd*2+1]+=flg1[nd];
t1[nd]+=flg1[nd];
flg1[nd] = 0;
}
void upd1(int l, int r, int v, int nl = 0, int nr = n - 1, int nd = 1)
{
push1(nd);
if(l > nr || r < nl) return;
if(l == nl && r == nr)
{
flg1[nd] += v;
push1(nd);
return;
}
int md = (nl + nr)/2;
upd1(l,min(md, r), v, nl, md, nd*2);
upd1(max(md + 1, l), r, v, md + 1, nr, nd*2+1);
# | 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... |