摘要: 1.统计颜色,或运算的运用2.区间第k大数3.一个很经典的题5.求区间相等数字的个数6.RMQ模板题,区间最大值和最小值的差1.很好的思路,用或运算来避免左右儿子树总相同颜色的情况。由于T颜色种类最多30种,__int64 足够用了。注意初始化就行。5.关键是写对make_up()这个函数,向上更新需要考虑的问题。经典题型。1001 1 /* 2 3 求区间[l,r]中,颜色的总类。 4 如何避免重复?----或运算。 5 6 */ 7 8 #include 9 #include 10 #include 11 #include 12 #define HH 1 13 us... 阅读全文
posted @ 2013-08-04 16:15 芷水 阅读(214) 评论(2) 推荐(0) 编辑
摘要: 1.内存控制2.敌兵布阵4.广告牌5.区间第k大数(模板题)6.just a Hook7.I Hate It8.动态的最长递增子序列(区间更新题)9.图灵树10.覆盖的面积14.买票问题16.村庄问题17.Hotel19.矩形周长问题23.区间第k大数问题26.海报问题1001 1 /* 2 3 内存控制 4 4种操作: 5 1.Reset 初始化 6 2.New x 开辟长度为x的连续的空间,输出起始位置 7 3.Free x 释放包含第x字节的块,整块都释放掉 8 4.Get x 输出当前状态下,内存里第x块的起始位置 9 10 思路: 11 1.Reset 很简单... 阅读全文
posted @ 2013-08-04 16:10 芷水 阅读(336) 评论(0) 推荐(0) 编辑
摘要: PictureTime Limit: 6000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2144Accepted Submission(s): 1139Problem DescriptionA number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizo 阅读全文
posted @ 2013-08-03 10:44 芷水 阅读(219) 评论(0) 推荐(0) 编辑
摘要: Memory ControlTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3610Accepted Submission(s): 841Problem DescriptionMemory units are numbered from 1 up to N.A sequence of memory units is called a memory block. The memory control system we consider now 阅读全文
posted @ 2013-08-01 16:37 芷水 阅读(290) 评论(0) 推荐(0) 编辑
摘要: Turing TreeTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2592Accepted Submission(s): 884Problem DescriptionAfter inventing Turing Tree, 3xian always felt boring when solving problems about intervals, because Turing Tree could easily have the solu 阅读全文
posted @ 2013-07-30 19:29 芷水 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Asteroids!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2542 Accepted Submission(s): 1719 Problem DescriptionYou're in space. You want to get home. There are asteroids. You don't want to hit them.InputInput to this problem will consist 阅读全文
posted @ 2013-07-19 21:43 芷水 阅读(327) 评论(0) 推荐(0) 编辑
摘要: A Walk Through the ForestTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4386 Accepted Submission(s): 1576 Problem DescriptionJimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax aft 阅读全文
posted @ 2013-07-18 23:54 芷水 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 漫步校园Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2183Accepted Submission(s): 627Problem DescriptionLL最近沉迷于AC不能自拔,每天寝室、机房两点一线。由于长时间坐在电脑边,缺乏运动。他决定充分利用每次从寝室到机房的时间,在校园里散散步。整个HDU校园呈方形布局,可划分为n*n个小方格,代表各个区域。例如LL居住的18号宿舍位于校园的西北角,即方格(1,1)代表的地方,而机房所在的第三实验 阅读全文
posted @ 2013-07-18 17:35 芷水 阅读(232) 评论(0) 推荐(0) 编辑
摘要: How many waysTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1869Accepted Submission(s): 1144Problem Description这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3.机器人不能在原地停留。4.当机器人选择了一 阅读全文
posted @ 2013-07-17 19:20 芷水 阅读(313) 评论(0) 推荐(0) 编辑
摘要: FatMouse and CheeseTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3521Accepted Submission(s): 1394Problem DescriptionFatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is label 阅读全文
posted @ 2013-07-17 19:16 芷水 阅读(300) 评论(0) 推荐(0) 编辑