线段树
cherish__lin
I want to be better!
展开
-
J - Assign the task (线段树+DFS建树)
There is a company that has N employees(numbered from 1 to N),every employee in the company has a immediate boss (except for the leader of whole company).If you are the immediate boss of someone,that ...原创 2019-02-18 22:54:15 · 112 阅读 · 0 评论 -
E - Sasha and Array(线段树+矩阵快速幂)
Sasha has an array of integers a1, a2, ..., an. You have to perform m queries. There might be queries of two types:1 l r x — increase all integers on the segment from l to r by values x; 2 l r — fi...原创 2019-02-19 13:56:06 · 381 阅读 · 0 评论 -
D - Mayor's posters(线段树+离散化)
The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally d...原创 2019-03-09 13:53:31 · 215 阅读 · 0 评论 -
I - Tunnel Warfare(线段树+区间合并)
During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels lay in a line. Except t...原创 2019-03-09 22:49:56 · 216 阅读 · 0 评论 -
F - Building Numbers(前缀和Or线段树)
In this problem, you can build a new number starting from 1, by performing the following operations as much as you need:Add 1 to the current number. Add the current number to itself (i.e. multiply ...原创 2019-03-04 00:20:01 · 606 阅读 · 0 评论 -
P - Atlantis (线段树+扫描线)
There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps describe diff...原创 2019-03-20 09:25:58 · 144 阅读 · 0 评论 -
O - 覆盖的面积 (线段树+扫描线)
给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积.Input输入数据的第一行是一个正整数T(1<=T<=100),代表测试数据的数量.每个测试数据的第一行是一个正整数N(1<=N<=1000),代表矩形的数量,然后是N行数据,每一行包含四个浮点数,代表平面上的一个矩形的左上角坐标和右下角坐标,矩形的上下边和X轴平行,左右边和Y轴平行.坐标的范围从0到1...原创 2019-03-20 17:09:07 · 149 阅读 · 0 评论 -
K - Transformation (区间标记思想)
Yuanfang is puzzled with the question below:There are n integers, a 1, a 2, …, a n. The initial values of them are 0. There are four kinds of operations.Operation 1: Add c to each number between a x...原创 2019-03-18 20:10:06 · 274 阅读 · 0 评论 -
L - Vases and Flowers(线段树+二分查找)
Alice is so popular that she can receive many flowers everyday. She has N vases numbered from 0 to N-1. When she receive some flowers, she will try to put them in the vases, one flower in one vase. ...原创 2019-03-18 22:24:08 · 287 阅读 · 0 评论