码迷,mamicode.com
首页 >  
搜索关键字:区间    ( 16036个结果
非结构体线段树版 ZJU 1610 Count the Colors (线段树区间更新)
Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones. Your task is counting the segments of different colors you can see at last. ...
分类:其他好文   时间:2014-08-14 10:47:38    阅读次数:222
HDU 1754 I Hate It
题解:线段树单点更新区间求极值。#include #include using namespace std;int a,b,q[200005],t[1200000];void build(int l,int r,int x){ int mid=(l+r)>>1; if(l==r){t[x...
分类:其他好文   时间:2014-08-14 10:27:08    阅读次数:181
POJ 3264 Balanced Lineup ST表
RMQ(区间最大值,最小值)问题的解决,ST表的应用。...
分类:其他好文   时间:2014-08-14 01:38:27    阅读次数:198
线段树 区间更新
poj3468 A Simple Problem with Integers( m - ( m >> 1 ) )这里跪了几发。。 - 的优先级大于 >> 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #incl...
分类:其他好文   时间:2014-08-14 01:10:37    阅读次数:343
POJ 2777 Count Color (线段树区间更新加查询)
Description Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. There is a very long board with length L...
分类:其他好文   时间:2014-08-13 22:28:57    阅读次数:401
PKU 2528 Mayor's posters
题意: 一个公告板上面贴海报,宽度都是一样的,长度可能不一样。后面的海报可能把前面的覆盖掉。问最后能看见多少张不同的海报。思路: 这题原来做过,是用线段树的区间染色写的。记录每个区间是纯色还是杂色。最后统计所有颜色。 今天发现可以用一种类似扫描线的想法来做。想象一条扫描线从左往右走。用set来...
分类:其他好文   时间:2014-08-13 21:37:57    阅读次数:225
HDU 1698 Just a Hook (线段树区间更新)
Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same...
分类:其他好文   时间:2014-08-13 18:59:07    阅读次数:226
hdu 1695 GCD(欧拉函数+容斥原理)
http://acm.hdu.edu.cn/showproblem.php?pid=1695 很经典的题,同时感觉也很难。 在区间[a,b]和[c,d]内分别任意取出一个数x,y,使得gcd(x,y) = k。问这样的(x,y)有多少对。可以认为a,c均为1,而且gcd(5,7)与gcd(7,5)是同一种。 因为gcd(x,y) = k,那么gcd(x/k,y/k) = 1,也就是求...
分类:其他好文   时间:2014-08-13 18:49:33    阅读次数:209
UnderScore的使用实例记录
_.range(),主要用于区间的获取操作。参数说明:(param1):范围上限,(param1,param2):起始及结束范围,(param1,param2,param3):起始结束范围,正数则为区间跨度,-1则为:负数区间跨度。_.range(10);=> [0, 1, 2, 3, 4, 5, ...
分类:其他好文   时间:2014-08-13 17:41:56    阅读次数:197
省常中模拟 Test1 Day1
临洮巨人排序题意:在字符串中找出 A、B、C 三个字母出现次数相同的区间个数。初步的解法是前缀和,用 a(i), b(i), c(i) 表示在位置 i 之前(包括 i)各有 字母 A、B、C 多少个,枚举区间的左右端点 l 和r,若a(r)-a(l-1) = b(r)-b(l-1) = c(r)-c...
分类:其他好文   时间:2014-08-13 14:34:06    阅读次数:264
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!