#define PROBLEM "https://yukicoder.me/problems/no/650"
#include<bits/stdc++.h>#define REP(i, n) for (int i = 0; i < (n); i++)
#include"library/algebra/group/Multiply.hpp"
#include"library/linearalgebra/SquareMatrix.hpp"
#include"library/mod/Modint.hpp"
#include"library/tree/EdgeVertex.hpp"
#include"library/tree/Tree.hpp"
#include"library/tree/TreeMonoid.hpp"usingmint=Mint<longlong,1000'000'007>;usingMAT=SquareMatrix<mint,2>;intmain(){std::ios::sync_with_stdio(false);std::cin.tie(nullptr);intn;std::cin>>n;EdgeVertexEV(n);REP(_,n-1){intu,v;std::cin>>u>>v;EV.add_edge(u,v);}TreeT=EV.build();TreeMonoid<Tree,GroupMultiply<MAT,false>>TM(T);intq;std::cin>>q;REP(_,q){charc;std::cin>>c;if(c=='x'){intidx;std::cin>>idx;MATM;REP(i,2)REP(j,2)std::cin>>M[i][j];TM.set(n+idx,M);}else{intl,r;std::cin>>l>>r;MATM=TM.path_prod(l,r);REP(i,2)REP(j,2)std::cout<<M[i][j]<<"\n "[i+j<2];}}}
Traceback(mostrecentcalllast):File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/documentation/build.py",line71,in_render_source_code_statbundled_code=language.bundle(stat.path,basedir=basedir,options={'include_paths':[basedir]}).decode()~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/languages/cplusplus.py",line187,inbundlebundler.update(path)~~~~~~~~~~~~~~^^^^^^File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py",line401,inupdateself.update(self._resolve(pathlib.Path(included),included_from=path))~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py",line401,inupdateself.update(self._resolve(pathlib.Path(included),included_from=path))~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py",line312,inupdateraiseBundleErrorAt(path,i+1,"#pragma once found in a non-first line")onlinejudge_verify.languages.cplusplus_bundle.BundleErrorAt:library/segtree/SegmentTree.hpp:line3:#pragmaoncefoundinanon-firstline