E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
1698
HDU
1698
Just a Hook (线段树区间修改)
题目链接:HDU
1698
JustaHook【题目大意】在Dota里面有个角色叫屠夫,他的武器是MeatHook,对所有的英雄都有着致命的威胁,MeatHook由一系列连续金属构成(假设有N块金属),金属有铜
chaiwenjun000
·
2015-08-24 17:00
数据结构
算法
线段树
HDOJ
1698
Just a Hook(区间更新)
JustaHookTimeLimit:4000/2000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):23067 AcceptedSubmission(s):11551ProblemDescriptionInthegameofDotA,Pudge’smeathookisactuallyth
helloiamclh
·
2015-08-21 20:00
hdu
1698
Just a Hook
线段树区间更新 菜鸟之伤__int64!!!!#include#include#includeusingnamespacestd;constintmaxn=100050;structTree{ intl,r,setv,sum;}tree[maxn=tree[id].r) return; if(tree[id].setv){ tree[id>1; build
efine_dxq
·
2015-08-21 16:00
C++
线段树
ACM
HDU
HDU
1698
Just a Hook
pid=
1698
题意:给出一段1~n的区间,区间内所有数初始为1,现在可以修改区间内任意一段,问m次修改后区间的和思路:区间更新以及区间询问,一个一个点进行修改复杂度太高,这里就使用了lazy标记,当整个区间都更改为
csdn364988181
·
2015-08-20 19:00
数据结构
ACM
HDU
1698
--Just a Hook(成段更新)
题目大意:给出一个区间,更换某一个子区间中的所有值,所有操作结束后,求区间和分析:线段树,成段更新。需要用到延迟标记(或者说懒惰标记),简单来说就是每次更新的时候不要更新到底,用延迟标记使得更新延迟到下次需要更新or询问到的时候。另一篇解题报告讲解较为详细http://blog.csdn.net/hhhhhhj123/article/details/47067873这里的sum数组和add数组与链
hhhhhhj123
·
2015-08-17 10:00
HDU
1698
Just a Hook (线段树 成段更新)
题目大意:就是现在一串钩子初始每个部分价值为1,每次操作修改其中连续的一整段的价值,问经过Q次操作之后整串钩子的总价值钩子长度N #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include
u013738743
·
2015-08-16 11:00
线段树
HDU
hook
a
Just
1698
成段更新
HPOJ
1698
: 海域, 冰山, 战舰【DFS】
1698
:海域,冰山,战舰时间限制:1Sec 内存限制:128MB提交:17 解决:5[提交][状态][讨论版]题目描述给出一个n*n的海洋,#代表海域,.代表冰山,要在海域中放置k个战舰,战舰会攻击同一行同一列的其他战舰
lin14543
·
2015-08-15 15:00
DFS
HPU
HDU-
1698
Just a Hook(区间更新)
JustaHookTimeLimit:4000/2000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):22759 AcceptedSubmission(s):11383ProblemDescriptionInthegameofDotA,Pudge’smeathookisactuallyth
Litter_Limbo
·
2015-08-13 16:00
线段树
ACM
HDU
杭电
hdu
1698
Just a Hook (线段树区间更新 懒惰标记)
JustaHookTimeLimit:4000/2000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):22730 AcceptedSubmission(s):11366ProblemDescriptionInthegameofDotA,Pudge’smeathookisactuallyth
su20145104009
·
2015-08-13 10:00
HDU
1698
hdu1698
线段树区间更新
懒惰标记
线段树(二)区间更新
hdu
1698
调试了很久,没想到一次ac了。注意:区间更新中用到一种技术,延迟更新pushdown(v)。如果不使用延迟更新,而一个个的更新,长度为n的区间更新需要nlogn,而数组直接更新只需要n。
u014451076
·
2015-08-10 14:00
线段树
hdu
1698
just a hook 线段树
懒惰标记的入门题==讲解详见小伙伴的博客 点击打开链接 貌似只是加了注释==我的代码->俩人改了好久才过==注意.LL .RR的区别#include #include #include usingnamespacestd; structnode { intl,r,val,tag; intmid(){return(l+r)/2;} }tree[300000]; voidbuild(introot,i
zhou_yujia
·
2015-08-08 18:00
算法
线段树
poj
懒惰标记
hdu
1698
链接:点击打开链接题意:给出一个t代表几组数据,给出一个n代表1~n都为1,然后输入命令(x,y,z),(x,y)为区间,z为将区间内的数改为z代码:#include #include #include #include usingnamespacestd; constintSIZE=100005; intadd[SIZE>1)); sum[rt>1); add[rt]=0; }
stay_accept
·
2015-08-08 16:00
hdu
1698
Just a Hook(线段树区间更新·经典)
pid=
1698
数据:case,n,q,q行x,y,z。在长度为n的hook上进行q次区间更新,把它们的价值改变。最后统计总的价值。x,y,z分别表示把[x,y]内的hook变成价值为z的hook。
theArcticOcean
·
2015-08-07 22:00
线段树
HDU
南邮 OJ 1133 搜索(三)
搜索(三)时间限制(普通/Java) : 1500MS/ 4500MS 运行内存限制:65536KByte总提交:
1698
测试通过:364 比赛描述给定整数序列,查询多个整数是否存在
changshu1
·
2015-08-05 09:00
ACM
南邮OJ
搜索三
线段树-区间更新
这里我一HDU上的
1698
为例,题目如下http://acm.hdu.edu.cn/showproblem.php?
六炅
·
2015-08-04 10:47
hdu
1698
Just A Hook 线段树的一道题
关于线段树的概念,这个blog写的很详细,大家可以看一下http://www.cnblogs.com/shuaiwhu/archive/2012/04/22/2464583.htmlhdu
1698
JustAHook
ddmike2015
·
2015-08-02 17:58
线段树
HDU
1698
Just a Hook (线段树区间更新)
JustaHookTimeLimit:4000/2000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):21856 AcceptedSubmission(s):10963ProblemDescriptionInthegameofDotA,Pudge’smeathookisactuallyth
Tc_To_Top
·
2015-07-30 23:00
HDU
线段树区间更新
HDU-
1698
-Just a Hook-区间更新
pid=
1698
好吧,这个题目我起初想试试我不用延迟更新能不能过,嘿嘿,我还是太天真了。。。
wlxsq
·
2015-07-30 09:00
hook
a
Just
hdu1698
线段树区间更新
lazy思想
E - Just a Hook - hdu
1698
(区间覆盖)
某个英雄有这样一个金属长棍,这个金属棍有很多相同长度的短棍组成,大概最多有10w节,现在这个人有一种魔法,他可以把一段区间的金属棍改变成别的物质,例如金银或者铜, 现在他会有一些操作在这个金属棍上,他想知道这些操作结束后金属棍的质量是多少呢?(PS,一节铜重量1, 银 2 ,金3)。 分析:如果做了那到海报覆盖的题目会发现这两题是差不多的,都可以从后面往前去覆盖,只不过返回这次能覆盖多少节就行了
·
2015-07-26 18:00
HDU
OO’s Sequence(多校第一场A题)
sSequenceTimeLimit:4000/2000MS(Java/Others)MemoryLimit:131072/131072K(Java/Others)TotalSubmission(s):
1698
AcceptedSubmission
林下的码路
·
2015-07-22 21:52
ACM
HDU
Shell练习-统计出每个IP的访问量有多少?
下载下面的日志并且复制粘贴到你的Linux里,然后进行统计分析: 1.log (118.01KB,下载次数:
1698
) 要求:统计出每个IP的访问量有多少?
ln286577399
·
2015-07-22 21:21
shell
HDU
1698
Just a Hook 线段树 成段替换
http://blog.csdn.net/u013368721/article/details/31374285segmenttree区间更新覆盖//Hello.I'mPeter. //#pragmacomment(linker,"/STACK:102400000,102400000") #include #include #include #include #include #include #
UESTC_peterpan
·
2015-07-03 15:00
hdoj
1698
Just a Hook 【线段树 区间修改】【线段树 + lazy思想】
JustaHookTimeLimit:4000/2000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):20406 AcceptedSubmission(s):10221ProblemDescriptionInthegameofDotA,Pudge’smeathookisactuallythem
chenzhenyu123456
·
2015-05-15 21:00
HDU -
1698
- Just a Hook (线段树-成段更新)
题目传送:JustaHook思路:线段树,成段替换,区间求和。成段更新时,注意延迟标记的作用,它就是用来暂停往下更新来达到节省时间的,然后每次更新每个节点的子节点之前都要判断是否需要往下更新。AC代码:#include #include #include #include #include #include #include #include #include #include #include
u014355480
·
2015-05-14 20:00
线段树
ACM
HDU
区间的维护和更新
POJ
1698
Alice's Chance (网络流)
构图:最多50周,350天源点到每一天连一条容量为1的边,对于每个电影,可以拍摄的那些天连一条容量为1的边到这个电影,每个电影连一条容量为需求总天数的边到汇点。看最大流是不是等于所有电影的需求总天数的和。点数为天数+电影数+2。代码:#include #include #include #include usingnamespacestd; #include #include #definemax
Baoli1008
·
2015-05-07 18:00
网络流
hdu
1698
Just a Hook 线段树 延时更新
JustaHookTimeLimit:4000/2000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):20252 AcceptedSubmission(s):10145ProblemDescriptionInthegameofDotA,Pudge’smeathookisactuallyth
wr132
·
2015-05-04 18:00
线段树
HDU
hook
a
Just
1698
延时更新
hdu
1698
屠夫(线段树成段替换)
题意:屠夫有钱了,要把他的钩子换成银的或者金的。解析:线段树成段替换。代码:#include #include #include #include #include #include #include #include #include #include #include #include #defineLLlonglong #definelsonlo,mi,rt>1))*lazy[rt]; su
u013508213
·
2015-04-22 21:00
(
1698
)线段树
#include#include#include#include#include#include#include#include#include#include#definell__int64#definelllunsignedlonglong#defineMAX3000001#defineeps1e-8#defineINF0xfffffff#definemod1000000007/*题意:线段树
wang57389675
·
2015-04-09 10:00
【线段树成段更新-模板】【HDU
1698
】Just a Hook
题意Q个操作,将l,r的值改为w问最后1,n的sum为多少成段更新(通常这对初学者来说是一道坎),需要用到延迟标记(或者说懒惰标记),简单来说就是每次更新的时候不要更新到底,用延迟标记使得更新延迟到下次需要更新or询问到的时候题意:O(-1)思路:O(-1)线段树功能:update:成段替换(由于只query一次总区间,所以可以直接输出1结点的信息)线段:1-N(题目天然给出)区间和性质:求sum
zy691357966
·
2015-04-08 11:00
HDU
1698
Just a Hook(线段树区间更新)
题意:屠夫是Dota中一个令所有英雄闻风丧胆的英雄。他有一个很长的钩子,这个钩子是用铜做的(刚刚开始都是1),现在他想要更改这些钩子,把某个区间的钩子改为金、银或铜。输入L,R,X表示把L~R的区间的数字改为X。最后求[1,N]的和。解析:这题是线段树区间修改的模板题。更新的时候采用了一种叫做延迟更新的技术,即需要更新某个区间的时候,暂时只更新这个区间,其子区间在有需要的时候再更新(否则每次更新都
HelloWorld10086
·
2015-03-31 20:00
HDU
1698
hdu
1698
Just a Hook
ProblemDescriptionInthegameofDotA,Pudge’smeathookisactuallythemosthorriblethingformostoftheheroes.Thehookismadeupofseveralconsecutivemetallicstickswhichareofthesamelength.NowPudgewantstodosomeoperatio
Kirito_Acmer
·
2015-03-30 19:00
线段树
线段树成段更新
hdu
1698
n个hook,每个初始化为1,m次操作,更新区间[x,y]的值为z,操作完毕后求所有hook之和。用g++超时。。。
u014679804
·
2015-03-24 21:00
poj
1698
Alice's Chance 最大流模板题
//建立一个超级源点和一个超级汇点//从超级源点到每一个film的权值为需要在这个film工作的天数D//然后从film到每个星期的第j天为一条权值为1的边//从每个星期的第j天到超级汇点的权值为1//这样就可以只需要验证从超级源点到超级汇点的最大流是否和所有film的天数之和是否相等#include#include#include#includeusingnamespacestd;#define
cq_pf
·
2015-03-18 22:00
线段树区间修改与区间增减的区别(个人总结)
pid=
1698
JustaHookTimeLimit:4000/2000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission
Enjoying_Science
·
2015-03-02 23:00
算法
ACM
Just a Hook(线段树成段更新)
pid=
1698
JustaHookTimeLimit:4000/2000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission
Enjoying_Science
·
2015-03-02 10:00
算法
ACM
Hdu
1698
Just a Hook(线段树成段更新)
题意很简单:1-n个钩子初始价值是1,然后题目给出Q个操作,xyz,将x->y的钩子价值改为z,最后输出n个钩子的总价值。线段树功能:update:成段替换 (由于只query一次总区间,所以可以直接输出1结点的信息)//3160KB624ms #include #include #include #include #defineM100005 #defineroot1,n,1 #definels
kalilili
·
2015-02-17 23:00
Just a Hook(线段树之点的成段更新)
萌萌哒的传送门/* *hdu
1698
*线段树的点的成段更新 *这道题不用预先建树,只需把1号节点延迟标记下就行 */ #include #include #include #include #include
ZSGG_ACM
·
2015-02-13 11:00
线段树
HDU1968 线段树区间更新
pid=
1698
区间更新的简单思想:区间更新是指更新某个区间内的叶子节点的值,因为涉及到的叶子节点不止一个,而叶子节点会影响其相应的非叶父节点,那么回溯需要更新的非叶子节点也会有很多,如果一次性更新完,
tenlee
·
2015-02-06 17:00
Ubuntu ssh server
所以去网上找了一个下载过来pdgk-i***安装,居然失败原来是有依赖libck-connector0和openssh-sftp-server把这两个依赖安装之后就能安装ssh-server了ps-e|grepssh
1698
xl1107202588
·
2015-01-13 14:40
虚拟机
server
网上
HDU 3785 寻找大富翁 (排序)
Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):4132 AcceptedSubmission(s):
1698
ProblemDescription
wdkirchhoff
·
2014-12-12 08:00
归并排序
HDU
快排
3785
Hduoj
1698
【线段树】
/*JustaHook TimeLimit:4000/2000MS(Java/Others)MemoryLimit:32768/32768K(Java/Others) TotalSubmission(s):18439AcceptedSubmission(s):9241 ProblemDescription InthegameofDotA,Pudge’smeathookisactuallythe
u014641529
·
2014-12-08 16:00
c
[线段树成段更新]hdoj
1698
题意: 对一个线段上的值进行修改,一次可以把[i,j]这个区间上的值改为1,2,或3。1---n这个区间上数字的和 思路: 一道很加深对成段更新理解的题目,需要成段更新加上一点技巧具体见代码update() #include<iostream> #include<cs
暴风雪
·
2014-11-27 21:00
线段树
POJ
1698
Alice's Chance 网络流(水
题目链接:点击打开链接题目大意: 有个人想拍n部电影,每部电影限定每周哪几天可以拍 并且必须在第ki周之前把这部电影拍完,问能否拍完n部电影解题思路: 把每部电影当作一个顶点,源点指向这些顶点,容量为该电影需要拍多少天 然后把每一天都当作顶点,某个工作可以在这天完成就连容量为1大边 每天的顶点指向汇点,容量也为1 最后求出最大流,
qq574857122
·
2014-11-16 20:00
HDU_
1698
Just a hook
//不懂得可以私信我,我也是菜鸟啊,可以一起讨论啊!!!#include #include #include usingnamespacestd; #defineMAX100005 intsum; structnode { intleft; intright; intvalue; }; nodetree[4*MAX]; voidBuild_tree(intp,intl,intr) { tree[
u014142379
·
2014-11-04 16:00
tree
HDU
datebase
segment
线段树区间更新——HDU
1698
对应HDU题目:点击打开链接JustaHookTimeLimit: 2000MS MemoryLimit: 32768KB 64bitIOFormat: %I64d&%I64uSubmit StatusDescriptionInthegameofDotA,Pudge’smeathookisactuallythemosthorriblethingformostoftheheroes.Thehooki
u013351484
·
2014-10-17 18:00
hdu
1698
Just a Hook
题意:看到题意和配图,我也是醉了。。。DotA屠夫的钩,是一节一节组成的,有n节,初始每节的长度是1。屠夫可以改变一个区间内每节的长度为1,2,3。。。问q次改变以后,总长度是多少。 思路:线段树(区间更新)。区间保存的是对应钩子区间每节的长度,如果区间内长度不一,则这个区间是无效的,需要考察这个区间的子区间,直到有一个统一的长度。#include #include #include
squee_spoon
·
2014-09-22 22:00
线段树
JS实现trigger click调用
转载:http://www.nowamagic.net/librarys/veda/detail/
1698
实现模拟trigger click方法,实现方式判断浏览器,判断nodeName
luqingxuan
·
2014-09-22 09:00
trigger
POJ
1698
Alice's Chance(网络流之最大流)
题目地址:POJ
1698
水题。。将每部电影与它可以演的那一天连边就行了。建二分图。用二分最大匹配也完全可以做。
u013013910
·
2014-08-18 15:00
编程
算法
C语言
ACM
网络流
hdu
1698
Just A Hook
题目链接:点击打开链接线段树区间更新区间查询,lazy标记模板题。每次修改某区间时,只需改当前区间,暂时先不修改子区间,而是打一个lazy标记,等到下次query或update时pushdown,按照父节点的lazy更新子节点,给子节点打上标记,再去掉父节点的标记。代码:#include #include #include #definelsonl,m,rt>1))*col[rt]; sum[rt
Baoli1008
·
2014-08-13 13:00
线段树
HDU
1698
Just a Hook(线段树区间替换)
题目地址:HDU
1698
区间替换裸题。同样利用lazy延迟标记数组,这里只是当lazy下放的时候把下面的lazy也全部改成lazy就好了。
u013013910
·
2014-08-09 10:00
编程
算法
线段树
C语言
ACM
上一页
7
8
9
10
11
12
13
14
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他