题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3308 题意:给你n个数,m个操作。操作有两种:1.U x y 将数组第x位变为y 2. Q x y 问数组第x位到第y位连续最长子序列的长度。对于每次询问,输出一个答案 题解:一道简单的线段树区间合并, ...
分类:
其他好文 时间:
2017-05-06 00:55:57
阅读次数:
165
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3308 题意:给定n个数,两个操作: U A B:将位置A的数值改成B Q A B:查询[A,B]内最长连续上升子序列的长度。 我认为当时的代码风格和现在的不一样(因为喜欢在Seg里存l和r的下标,然而根 ...
分类:
其他好文 时间:
2017-05-05 21:46:11
阅读次数:
204
Hotel Time Limit: 3000MS Memory Limit: 65536K 链接:POJ 3667 Description The cows are journeying north to ThunderBay in Canada to gain cultural enrichmen ...
分类:
其他好文 时间:
2017-05-01 14:17:05
阅读次数:
185
最近实在是懒的不想打代码。。。好像口胡也算一种训练,那就口胡把。 BZOJ 2243 染色(树链剖分) 首先树链剖分,然后记录下每个区间的左右端点颜色和当前区间的颜色段。再对每个节点维护一个tag标记。剩下的就是很normal的线段树区间合并和标记下传了。 BZOJ 2245 工作安排(费用流) 很 ...
分类:
其他好文 时间:
2017-04-10 21:33:40
阅读次数:
122
2243: [SDOI2011]染色 Description 给定一棵有n个节点的无根树和m个操作,操作有2类: 1、将节点a到节点b路径上所有点都染成颜色c; 2、询问节点a到节点b路径上的颜色段数量(连续相同颜色被认为是同一段),如“112221”由3段组成:“11”、“222”和“1”。 请你 ...
分类:
其他好文 时间:
2017-04-10 14:39:48
阅读次数:
277
【题目链接】 http://poj.org/problem?id=3368 【题目大意】 有一个有序序列,要求区间查询出现次数最多的数 【题解】 维护每个区间左端点和右端点,以及左右的长度,还有区间的答案 每次线段合并的时候,对区间数据进行合并即可。 【代码】 ...
分类:
其他好文 时间:
2017-01-22 11:51:57
阅读次数:
195
一、题目 Description During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Genera ...
分类:
其他好文 时间:
2016-12-28 21:25:00
阅读次数:
364
Description During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally s ...
分类:
其他好文 时间:
2016-11-11 23:36:39
阅读次数:
273
Description The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superi ...
分类:
其他好文 时间:
2016-11-09 22:32:59
阅读次数:
224
Description Given n integers. You have two operations: U A B: replace the Ath number by B. (index counting from 0) Q A B: output the length of the lon ...
分类:
其他好文 时间:
2016-11-07 22:24:48
阅读次数:
355