摘要: Description 给一棵树,每个点有点权 $a_i$ ,每次给 $u,v,x$ ,求 $u$ 到 $v$ 路径上每个点的点权与 $x$ 的 $gcd$ 的积。 $n,m\le 10^5,1\le a_i\le 10^7$ Solution 离线,答案相当与四条从根出发的链拼起来,分解质因数。 阅读全文
posted @ 2018-10-08 08:45 aziint 阅读(228) 评论(0) 推荐(0) 编辑
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.