# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1126243 | dwuy | Weirdtree (RMI21_weirdtree) | C++20 | 16 ms | 1604 KiB |
#include "weirdtree.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
struct Node{
ll fm, sm, cm, lz, sum;
Node() : fm(0), sm(-2), cm(0), sum(0) {}
};
struct SMT{
ll n;
vector<Node> tree;
SMT(ll n = 0) : n(n), tree(n<<2|3, Node()) {};
void down(ll id){
if(tree[id].lz == 0) return;
ll delta = tree[id].lz;
tree[id<<1].lz += delta;
tree[id<<1].fm += delta;
tree[id<<1].sum += delta * tree[id<<1].cm;
tree[id<<1|1].lz += delta;
tree[id<<1|1].fm += delta;
tree[id<<1|1].sum += delta * tree[id<<1|1].cm;
tree[id].lz = 0;
}
void update(ll id){
Node &L = tree[id<<1];
Node &R = tree[id<<1|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... |