This documentation is automatically generated by competitive-verifier/competitive-verifier
#define PROBLEM \
"https://judge.yosupo.jp/problem/vertex_add_subtree_sum"
#include <atcoder/fenwicktree>
#include "daylight/base.hpp"
#include "daylight/graph/hld.hpp"
using namespace atcoder;
int main() {
int N, Q;
cin >> N >> Q;
vi A(N);
cin >> A;
HLdecomposition hld(N);
FOR(i, 1, N) {
int p;
cin >> p;
hld.add_edge(p, i);
}
hld.build();
fenwick_tree<ll> fw(N);
REP(i, N) fw.add(hld.index(i), A[i]);
while(Q--) {
int k;
cin >> k;
if(k == 0) {
int u, x;
cin >> u >> x;
fw.add(hld.index(u), x);
} else {
int u;
cin >> u;
auto [l, r] = hld.subtree_query(u);
cout << fw.sum(l, r) << endl;
}
}
}
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj_resolve/resolver.py", line 181, in resolve
bundled_code = language.bundle(path, basedir=basedir)
File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj/verify/languages/cplusplus.py", line 252, in bundle
bundler.update(path)
File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 482, in update
self.update(
File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 477, in update
raise BundleErrorAt(
competitive_verifier.oj.verify.languages.cplusplus_bundle.BundleErrorAt: daylight/base.hpp: line 103: unable to process #include in #if / #ifdef / #ifndef other than include guards
| Env | Name | Status | Elapsed | Memory |
|---|---|---|---|---|
| g++ | example_00 |
|
6 ms | 3 MB |
| g++ | line_00 |
|
855 ms | 71 MB |
| g++ | line_01 |
|
864 ms | 71 MB |
| g++ | max_random_00 |
|
936 ms | 47 MB |
| g++ | max_random_01 |
|
1009 ms | 47 MB |
| g++ | max_random_02 |
|
1322 ms | 47 MB |
| g++ | random_00 |
|
816 ms | 37 MB |
| g++ | random_01 |
|
980 ms | 44 MB |
| g++ | random_02 |
|
443 ms | 8 MB |
| g++ | random_03 |
|
355 ms | 41 MB |
| g++ | random_04 |
|
303 ms | 27 MB |
| g++ | small_00 |
|
9 ms | 4 MB |
| g++ | small_01 |
|
8 ms | 3 MB |
| g++ | small_02 |
|
8 ms | 3 MB |
| g++ | small_03 |
|
8 ms | 4 MB |
| g++ | small_04 |
|
7 ms | 4 MB |