摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1232 【题解】 这种删边的题一般都是最小生成树,考虑边权,因为要往返,所以边权是原来边权*2+两端点权。 这样起点会少算一次。我们求出最小生成树后找一个点权最小的当起点就行了。。 # incl 阅读全文
posted @ 2017-06-07 15:49 Galaxies 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1230 【题解】 线段树裸题啊 # include <stdio.h> # include <string.h> # include <iostream> # include <algorith 阅读全文
posted @ 2017-06-07 15:19 Galaxies 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1231 【题解】 状压dp!f[S][i]表示状态为S,最后一个奶牛为i的方案数,枚举前一个奶牛判断即可。 # include <stdio.h> # include <string.h> # 阅读全文
posted @ 2017-06-07 15:18 Galaxies 阅读(244) 评论(1) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3939 【题解】 f[i][j] = s[i-1][j-1] - sum[a[i][j]] 用cdq分治来处理横坐标,先处理上面的dp值,再讨论上面部分对下面的贡献,然后分治处理下面的dp值即可 阅读全文
posted @ 2017-06-07 14:48 Galaxies 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4430 【题解】 把每只骆驼在第一个人、第二个人、第三个人的位置找出来,然后做三维偏序即可。 排序+cdq分治+BIT # include <stdio.h> # include <string 阅读全文
posted @ 2017-06-07 11:15 Galaxies 阅读(202) 评论(0) 推荐(0) 编辑