chuninsane

随笔分类 -  ACM数据结构

poj 2482 Stars in Your Window (线段树:区间更新)
摘要:题目链接:http://poj.org/problem?id=2482读完题干不免有些心酸(🐶🐶🐶)题意:有n个星星(星星i的坐标为xi, yi,亮度为ci),给你一个W*H的矩形,让你求得矩形能覆盖的星星的亮度和最大为多少思路:矩形大小是固定的,所以可以换个方向思考,把矩形看成一个点(坐标为... 阅读全文

posted @ 2015-11-02 17:56 chuninsane 阅读(241) 评论(0) 推荐(0)

hdu 3397 Sequence operation(线段树:区间更新)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3397 题意:给你一个长度为n的0,1序列,支持下列五种操作,操作0(0 a b):将a到b这个区间的元素全部置为0。操作1(1 a b):将a到b这个区间的元素全部置为1。操作2(2 a b):将a到b... 阅读全文

posted @ 2015-11-02 10:49 chuninsane 阅读(168) 评论(0) 推荐(0)

hdu 1166 敌兵布阵(树状数组)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1394题意:C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情... 阅读全文

posted @ 2015-11-02 10:32 chuninsane 阅读(137) 评论(0) 推荐(0)

hdu 1394 Minimum Inversion Number(树状数组)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1394题意:给你一个0 — n-1的排列,对于这个排列你可以将第一个元素放到最后一个,问你可能得到的最多逆序对的个数求出原始序列的逆序对的数目,然后进行n-1次将第一个元素放到最后一个的操作,每次操作后可... 阅读全文

posted @ 2015-11-02 10:26 chuninsane 阅读(200) 评论(0) 推荐(0)

UVALive 4329 Ping pong(树状数组)
摘要:题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=13895题意:一条街上住有n个乒乓选手,每个人都有一个技能值,现在每场比赛需要3个人,两个选手,一个裁判;裁判须住在他们之间,且其技能值必须在两选手之间,求一共能组织多... 阅读全文

posted @ 2015-11-02 09:56 chuninsane 阅读(167) 评论(0) 推荐(0)

UVALive 2191 Potentiometers (树状数组)
摘要:题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=192给你一个长度为n的数组A,有两种操作,操作一:(S x y) 将A[x]的大小... 阅读全文

posted @ 2015-11-02 09:43 chuninsane 阅读(235) 评论(0) 推荐(0)

UVA 12299 RMQ with Shifts(线段树:单点更新)
摘要:题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3720题意:给你一个可变的数组A,有两种操作。操作一:shift(i1, i2....in),将... 阅读全文

posted @ 2015-11-02 09:35 chuninsane 阅读(132) 评论(0) 推荐(0)

hdu 2222 Keywords Search(AC自动机模版题)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2222题意:多个短字符串和一个长字符串,求有多长个短字符串出现在长字符串中AC自动机的模版题#include #include #include #include #define sign_ma 26#d... 阅读全文

posted @ 2015-10-31 19:30 chuninsane 阅读(148) 评论(0) 推荐(0)

UVA 11732 strcmp() Anyone? (压缩版字典树)
摘要:题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2832按照正常的字典树建树会MLE所以需要采用树的压缩算法来建树#include #includ... 阅读全文

posted @ 2015-10-30 19:47 chuninsane 阅读(158) 评论(0) 推荐(0)

UVALive 3942 Remember the Word(字典树+DP)
摘要:题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1943题意:一个长字符串和多个短字符串,求短字符串有多少种方式组成长字符串。状态转... 阅读全文

posted @ 2015-10-30 16:03 chuninsane 阅读(130) 评论(0) 推荐(0)

UVA 11992 Fast Matrix Operations(线段树:区间修改)
摘要:题目链接2015-10-30https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3143给你一个矩阵,矩阵的每个元素初始值均为0进行m次操作,操作共有三种类型,... 阅读全文

posted @ 2015-10-30 14:22 chuninsane 阅读(152) 评论(0) 推荐(0)

导航