摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1160 给你一些老鼠的体重和速度,问你最多需要几只可以证明体重越重速度越慢,并输出任意一组答案。 结构体按照体重从小到大排序,然后根据速度就是最长下降子序列。 阅读全文
posted @ 2016-08-16 23:57 Recoder 阅读(232) 评论(0) 推荐(0) 编辑
摘要: LIS两种写法 O(n^2) dp[i]表示以a[i]结尾的为LIS长度 1 #include <algorithm> 2 #include <iostream> 3 #include <cstdlib> 4 #include <cstring> 5 #include <cstdio> 6 #inc 阅读全文
posted @ 2016-08-16 19:58 Recoder 阅读(553) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5458 给你n个点,m条边,q个操作,操作1是删边,操作2是问u到v之间的割边有多少条。 这题要倒着做才容易,倒着加边。 因为这题最后保证所有的点一定连通,所以可以构建一棵树,树链剖分一下。要是u到v之间 阅读全文
posted @ 2016-08-16 00:30 Recoder 阅读(438) 评论(0) 推荐(1) 编辑