摘要: 把每一辆赛车看成一条直线:y = v * t + b 其中 v表示速度,t表示时间,b表示初始位置 问题变成:求存在t使得直线的y值在所有直线中最大(允许一样大) 具体做法是 (如图所示,b 永远无法领头) 3.因为 t>=0,所以舍去交点不在第一象限的情况 ps:两直线交点横坐标求法: y=k1* 阅读全文
posted @ 2019-07-08 11:34 Mistletoes 阅读(1244) 评论(0) 推荐(0) 编辑
摘要: step1. 将所有半平面按极角排序,对于极角相同的,选择性的保留一个。 O(nlogn)step2. 使用一个双端队列(deque),加入最开始2个半平面。step3. 每次考虑一个新的半平面:a.while deque顶端的两个半平面的交点在当前半平面外:删除deque顶端的半平面b.while 阅读全文
posted @ 2019-07-04 19:34 Mistletoes 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.luogu.org/problemnew/show/CF700 先手动模拟一下: 原串:abracadabra s数组依次是:abracadabra,abra,a 可以发现,每一步我们找最长的在上一个串中出现两次的子串,即可得到最优解 很容易想到dp: 定义两个数组: 阅读全文
posted @ 2019-06-01 11:02 Mistletoes 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Viva La Vida by coldplay I used to rule the world Seas would rise when I gave the word Now in the morning I sleep alone Sweep the streets I used to ow 阅读全文
posted @ 2019-05-21 22:48 Mistletoes 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 开通博客第一天,纪念一下—— 阅读全文
posted @ 2019-05-19 22:54 Mistletoes 阅读(70) 评论(0) 推荐(0) 编辑