This documentation is automatically generated by competitive-verifier/competitive-verifier
#define PROBLEM \
"https://judge.yosupo.jp/problem/vertex_add_path_sum"
#include "daylight/base.hpp"
#include "daylight/graph/hld.hpp"
#include <atcoder/all>
using namespace atcoder;
int main() {
int N, Q;
cin >> N >> Q;
vi A(N);
cin >> A;
HLdecomposition hld(N);
REP(i, N - 1) {
int u, v;
cin >> u >> v;
hld.add_edge(u, v);
}
hld.build();
fenwick_tree<ll> fw(N);
REP(i, N) {
fw.add(hld.index(i), A[i]);
}
while(Q-- > 0) {
int k;
cin >> k;
if(k == 0) {
int p, x;
cin >> p >> x;
fw.add(hld.index(p), x);
} else {
int u, v;
cin >> u >> v;
ll ans = 0;
for(auto [l, r, rev]: hld.path_query(u, v)) {
ans += fw.sum(l, r);
}
cout << ans << 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++ | almost_line_00 |
|
1183 ms | 64 MB |
| g++ | almost_line_01 |
|
1187 ms | 62 MB |
| g++ | example_00 |
|
6 ms | 3 MB |
| g++ | line_00 |
|
1196 ms | 61 MB |
| g++ | line_01 |
|
1181 ms | 69 MB |
| g++ | long-path-decomposition_killer_00 |
|
1245 ms | 46 MB |
| g++ | max_random_00 |
|
1606 ms | 47 MB |
| g++ | max_random_01 |
|
1407 ms | 47 MB |
| g++ | max_random_02 |
|
1521 ms | 47 MB |
| g++ | random_00 |
|
1120 ms | 37 MB |
| g++ | random_01 |
|
1200 ms | 44 MB |
| g++ | random_02 |
|
676 ms | 8 MB |
| g++ | random_03 |
|
561 ms | 41 MB |
| g++ | random_04 |
|
418 ms | 27 MB |
| g++ | small_00 |
|
7 ms | 4 MB |
| g++ | small_01 |
|
6 ms | 3 MB |
| g++ | small_02 |
|
6 ms | 3 MB |
| g++ | small_03 |
|
6 ms | 3 MB |
| g++ | small_04 |
|
8 ms | 4 MB |