This documentation is automatically generated by competitive-verifier/competitive-verifier
#define PROBLEM \
"https://judge.yosupo.jp/problem/vertex_set_path_composite"
#include "daylight/base.hpp"
#include "daylight/graph/hld.hpp"
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using P = pair<mint, mint>;
P op(P a, P b) {
return { a.first * b.first,
a.second * b.first + b.second };
}
P op2(P a, P b) {
return { a.first * b.first,
a.first * b.second + a.second };
}
P e() {
return { 1, 0 };
}
int main() {
int N, Q;
cin >> N >> Q;
HLdecomposition hld(N);
vi a(N), b(N);
REP(i, N) {
cin >> a[i] >> b[i];
}
REP(i, N - 1) {
int u, v;
cin >> u >> v;
hld.add_edge(u, v);
}
hld.build();
segtree<P, op, e> seg(N);
segtree<P, op2, e> seg2(N);
REP(i, N) {
seg.set(hld.index(i), { a[i], b[i] });
seg2.set(hld.index(i), { a[i], b[i] });
}
while(Q-- > 0) {
int k;
cin >> k;
if(k == 0) {
int p, c, d;
cin >> p >> c >> d;
seg.set(hld.index(p), { c, d });
seg2.set(hld.index(p), { c, d });
} else {
int u, v;
cin >> u >> v;
int y;
cin >> y;
mint x(y);
for(auto [l, r, rev]: hld.path_query(u, v)) {
if(rev) {
auto [c, d] = seg2.prod(l, r);
x = c * x + d;
} else {
auto [c, d] = seg.prod(l, r);
x = c * x + d;
}
}
cout << x.val() << 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 |
|
747 ms | 32 MB |
| g++ | almost_line_01 |
|
648 ms | 33 MB |
| g++ | example_00 |
|
6 ms | 3 MB |
| g++ | example_01 |
|
5 ms | 3 MB |
| g++ | line_00 |
|
736 ms | 35 MB |
| g++ | line_01 |
|
665 ms | 36 MB |
| g++ | long-path-decomposition_killer_00 |
|
754 ms | 29 MB |
| g++ | max_random_00 |
|
779 ms | 30 MB |
| g++ | max_random_01 |
|
685 ms | 30 MB |
| g++ | max_random_02 |
|
683 ms | 30 MB |
| g++ | random_00 |
|
489 ms | 19 MB |
| g++ | random_01 |
|
497 ms | 25 MB |
| g++ | random_02 |
|
319 ms | 10 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 |
|
9 ms | 4 MB |
| g++ | small_04 |
|
8 ms | 4 MB |