摘要: "P1195 口袋的天空" 先将每个点看做一棵生成树 合并时生成树个数 1 cpp include include include using namespace std; struct node { int point1; int point2; int weight; }; node line[ 阅读全文
posted @ 2018-04-03 11:28 Lance1ot 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 如题 真坑呀!!! 可算过了 我率先达到了氧气富有化 先是改变时没有fall。40分 然后是fall函数写慢了 tle 50分 . 上代码 cpp include include include using namespace std; struct node { int m[6][9]; bool 阅读全文
posted @ 2018-04-03 08:15 Lance1ot 阅读(170) 评论(0) 推荐(0) 编辑
摘要: "P2761 软件补丁问题" 每种错误只有有与没有两种情况 错误数只有二十 我们就可以二进制压缩一下状态 而且对于错误情况相同的情况,只要遍历到了一次,那么这种情况的最优解就已经出粗来了 但是 题目中是有可能有环的 bfs就可以了 利用二进制储存一下状态 cpp include include in 阅读全文
posted @ 2018-04-02 14:45 Lance1ot 阅读(177) 评论(0) 推荐(0) 编辑
摘要: "P1266 速度限制" 第一次接触这种分层spfa 类似于dp ~~个人理解~~ 阅读全文
posted @ 2018-04-01 18:42 Lance1ot 阅读(167) 评论(0) 推荐(0) 编辑
摘要: "P1186 玛丽卡" 读题真的好恶心 实际上是考察了spfa中路径记录的问题 cpp include include include include using namespace std; struct node { int point; int nxt; int weight; }; node 阅读全文
posted @ 2018-04-01 14:16 Lance1ot 阅读(142) 评论(0) 推荐(0) 编辑
摘要: "P1024 一元三次方程求解" cpp include include include using namespace std; double a,b,c,d; double f(double data) { return a data data data+b data data+c data+d 阅读全文
posted @ 2018-03-30 20:31 Lance1ot 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 并查集的变式题 (⊙o⊙)…。好像我并不大会表达 还是直接代码吧 阅读全文
posted @ 2018-03-30 19:10 Lance1ot 阅读(205) 评论(0) 推荐(0) 编辑
摘要: "P2253 好一个一中腰鼓!" 本蒟蒻第一次用线段树做连续最长子段 线段树是将一个大区间二分成两个小区间,通过递归解决两个小区间的问题,然后合并。得到大区间的解。 类比一下分治法求单个最长连续子段。 每次也都是将一个大区间分成两个小区间。分别解决完小区间后。将小区间合并,从分界点左右遍历。暴力的求 阅读全文
posted @ 2018-03-29 19:26 Lance1ot 阅读(173) 评论(0) 推荐(0) 编辑
摘要: "P1340 兽径管理" 这道题van♂可以倒序做。 加边就是剪边 cpp include include include include using namespace std; struct node { int point1; int point2; int dis; int num; }; 阅读全文
posted @ 2018-03-29 18:46 Lance1ot 阅读(126) 评论(0) 推荐(1) 编辑
摘要: "题目" cpp include include include using namespace std; struct node { long long l; long long r; }; node data[100000]; bool compare(const node&a,const no 阅读全文
posted @ 2018-03-28 20:56 Lance1ot 阅读(141) 评论(0) 推荐(0) 编辑