随笔分类 - 数据结构
摘要:分析 除了树剖没想到其他解法。 用线段树维护区间和,同时针对修改区间修改操作建立两个lazy标记,一个是$lazy_{mul}$,另一个是$lazy_{add}$,代表区间里的数都需要先乘以$lazy_{mul}$,再加上$lazy_{add}$。如果一个区间需要被重复标记,那么我们可以先把新的la
阅读全文
摘要:Problem Description Chika is elected mayor of Numazu. She needs to manage the traffic in this city. To manage the traffic is too hard for her. So she
阅读全文
摘要:题目描述 You have N integers A1, A2, ... , AN. You are asked to write a program to receive and execute two kinds of instructions: 1. C a b means performin
阅读全文
摘要:题目描述 For this problem, you will write a program that reads in a sequence of 32 bit signed integers. After each odd indexed value is read, output the m
阅读全文
摘要:题意 给一棵有权值的树,每次询问给u,v,x,问u到v的路径上所有点的权值与x的gcd的乘积(对1e9+7取模) 分析 + 离线搞 + 对于每个素数单独处理 + 每确定一个素数之后,从低到高枚举该素数的指数,并把跟这个素数相关的点拿出来更新在树上更新指数的大小。更新完毕之后,可以求得u,v之间指数的
阅读全文
摘要:标签: 线段树 题目链接 https://codeforces.com/contest/981/problem/E 分析 在线段树的每个节点维护一个 . 代码 cpp include include include include include include include using name
阅读全文

浙公网安备 33010602011771号