
分治
Thyhhhhhh
弱鸡一枚
展开
-
poj1905 Expanding Rods
When a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounted on two solid walls and then heated,原创 2017-07-14 16:20:16 · 211 阅读 · 0 评论 -
poj3301 Texas Trip (三分)
这个三分法对我来说是个比较陌生的东西,就在这里总结一下二分法适用于单调函数,但是对于单峰函数的解决,就只能用三分法求解极值了。对于三分法的话,给一个大神博客的链接:http://chenjianneng3.blog.163.com/blog/static/128345126201033101044920/好了,转到正题,这道题的题意是:求出能覆盖一些点的正方形的面积原创 2017-07-15 08:48:31 · 344 阅读 · 0 评论 -
poj3714 Raid (分治)
After successive failures in the battles against the Union, the Empire retreated to its last stronghold. Depending on its powerful defense system, the Empire repelled the six waves of Union's attack.原创 2017-07-14 19:00:35 · 297 阅读 · 0 评论 -
poj2503 Babelfish(map,二分)
You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInpu原创 2017-07-15 11:18:21 · 295 阅读 · 0 评论 -
贪心+二分 openjudge746 Elevator Stopping Plan
题意:某个抠门的公司只有一个电梯, 现在有n 个人从1楼, 他们有各自想要到达的楼层, 然后电梯每上一楼需要4 秒, 每在一个楼层开门需要10 秒, 然后然爬楼梯的话需要20一楼。问, 如何用最短的时间让所有人都到达各自想要到的楼层题解:如题,感觉以前做过的贪心题都弱爆了。。。这道题的思路是二分加贪心二分最后一个到达的人的时间,那么这时,所有的问题就是判断这个时间原创 2017-07-17 11:30:24 · 972 阅读 · 0 评论 -
poj1987 树的点分治
题意:给你一颗n(n题解:关于树的分治,这我还是第一次遇到,决定好好总结下,以备以后再遇到这种类型的题原创 2017-08-04 17:18:41 · 278 阅读 · 0 评论 -
noip 模拟赛(by azui大爷) day2 t2(附O(1)求RMQ)
看到第三题是个毒瘤题,于是先来写下第二题的题解。题意:给你一颗二叉树,要求在不改变其中序遍历的前提下,改变树的结构,使新树前序遍历的字典序最小,输出这个前序遍历题解:表示好久都没有复习什么先序后序遍历了,结论什么的都忘干净了于是这道题我直接输的12345……,还骗到20分。这道题如果按照改变树的结构的思路来想的话,其实就是AVL中的zig,zag原创 2017-08-14 20:42:01 · 332 阅读 · 0 评论