
树状数组
文章平均质量分 68
Dagon_
这个作者很懒,什么都没留下…
展开
-
CCF201709-5 除法 树状数组
问题描述 小葱喜欢除法,所以他给了你N个数a1, a2, ⋯, aN,并且希望你执行M次操作,每次操作可能有以下两种: 给你三个数l, r, v,你需要将al, al+1, ⋯, ar之间所有v的倍数除以v。 给你两个数l, r,你需要回答al + al+1 + ⋯ + ar的值是多少。输入格式 第一行两个整数N, M,代表数的个数和操作的次数。 接下来一行N个整数,代表N个数原创 2017-11-02 18:00:07 · 421 阅读 · 0 评论 -
Zbazi in Zeydabad CodeForces - 628E 树状数组
A tourist wants to visit country Zeydabad for Zbazi (a local game in Zeydabad). The country Zeydabad is a rectangular table consisting of n rows and m columns. Each cell on the country is either ‘z’原创 2017-11-03 23:25:40 · 374 阅读 · 0 评论 -
Codeforces 652D Nested Segments 树状数组离线处理
You are given n segments on a line. There are no ends of some segments that coincide. For each segment find the number of segments it contains.Input The first line contains a single integer n (1 ≤ n ≤原创 2017-11-15 21:57:18 · 401 阅读 · 0 评论