码迷,mamicode.com
首页 >  
搜索关键字:单点更新    ( 496个结果
【POJ 2886】Who Gets the Most Candies?
题 题意 约瑟夫问题的升级版,每次出去的是前一个出去的人位置+手上的数字(正往前,负往后)。第i个出去的人拿的糖是i的约数的个数。求拿糖最多的人和他的糖果数。 分析 线段树单点更新,反素数。 我竟然WA在了反素数少了几个QAQ 代码 #include<cstdio> #include<cstring
分类:其他好文   时间:2016-02-20 07:00:33    阅读次数:188
HDU 1754 I Hate It 线段树 单点更新 区间最大值
1 #include<iostream> 2 #include<string> 3 #include<algorithm> 4 #include<cstdlib> 5 #include<cstdio> 6 #include<set> 7 #include<map> 8 #include<vector
分类:其他好文   时间:2016-02-19 23:12:40    阅读次数:371
【HDOJ】4366 Successor
基本思路是将树形结构转换为线性结构。然后,所求即为一个区间内大于abi的最大的loy指向的ID。将结点按照abi降序排序,注意abi可能相等。然后,使用线段树单点更新,区间查询可解。 1 /* 4366 */ 2 #include <iostream> 3 #include <sstream> 4
分类:其他好文   时间:2016-02-19 12:36:27    阅读次数:195
Codeforces 85D Sum of Medians(线段树)
题目链接:Codeforces 85D - Sum of Medians 题目大意:N个操作,add x:向集合中加入x;del x:删除集合中的x;sum:将集合排序后,将集合中全部下标i % 5 = 3的元素累加求和。 解题思路:线段树单点更新,每一个点维护5个值。分别表示从该段区间中i % 5
分类:其他好文   时间:2016-01-30 13:55:10    阅读次数:156
POJ2828 Buy Tickets 【线段树】+【单点更新】+【逆序】
Buy TicketsTime Limit:4000MSMemory Limit:65536KTotal Submissions:12296Accepted:6071DescriptionRailway tickets were difficult to buy around the Lunar N...
分类:其他好文   时间:2016-01-27 12:48:56    阅读次数:150
POJ 2828 线段树单点更新 离线搞
DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year ...
分类:其他好文   时间:2016-01-21 23:51:02    阅读次数:268
HDU4027(线段树单点更新区间)
Can you answer these queries?Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 11333Accepted Submiss...
分类:其他好文   时间:2016-01-13 19:30:28    阅读次数:176
HDU1754_I Hate It(线段树/单点更新)
解题报告题意:略思路:单点替换,区间最值#include #include #include #define inf 99999999using namespace std;int maxx[808000];void update(int root,int l,int r,int p,int v)....
分类:其他好文   时间:2016-01-05 18:48:00    阅读次数:196
fafu 1100 线段树
题目链接单点更新, 区间查询。 这题空间好小....#include #include #include #include #include #include #include #include #include #include using namespace std;#define pb(x) ...
分类:其他好文   时间:2015-12-07 20:20:57    阅读次数:204
UVALive 6709 - Mosaic 二维线段树
题目链接给一个n*n的方格, 每个方格有值。 每次询问, 给出三个数x, y, l, 求出以x, y为中心的边长为l的正方形内的最大值与最小值, 输出(maxx+minn)/2, 并将x, y这个格子的值改为(maxx+minn)/2。题目保证l为奇数。二维线段树的单点更新, 区间查询。 1 #i....
分类:其他好文   时间:2015-12-07 12:32:53    阅读次数:193
496条   上一页 1 ... 19 20 21 22 23 ... 50 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!