HDU1398 题意:把一个整数分拆成1、4、9、16、……、256、289(注意:只到289)这17个完全平方数的和,有几种方法。 解法不用说自然是DP,因为搜索显然超时。 (这样的题我一般不敢开int,怕爆……) HDU1028 自然数无序拆分 恩,经典的DP题 二维的方法……但是我以前用一维的 ...
分类:
其他好文 时间:
2016-11-12 20:06:22
阅读次数:
251
As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some ro ...
分类:
其他好文 时间:
2016-11-12 19:09:40
阅读次数:
149
/** * 测试新增图片 * @throws IOException * @throws HttpException * @throws SAXException * @throws ParserConfigurationException */ // @Test// public void Tes ...
分类:
Web程序 时间:
2016-11-11 14:47:46
阅读次数:
896
Description 一棵树,统计距离不大于 \(k\) 的点对个数. Sol 点分治. 发现自己快把点分治忘干净了... 找重心使所有儿子的最大值尽量小,然后每次处理全部子树,再减去每个子树的贡献,这样就得到子树间的贡献了,然后再搞子树就可以,这就是一个子问题了. Code ...
分类:
其他好文 时间:
2016-11-10 09:37:20
阅读次数:
241
Description 给你一个图,两个点至多有一条路径,求最长的一条路径. \(n \leqslant 4\times 10^4\) Sol DFS?DP? 这就是一棵树,方向什么的都没用... 然后记录一下到这个点的最大值和次大值更新答案即可. Code ...
分类:
其他好文 时间:
2016-11-10 07:48:13
阅读次数:
188
Description 一棵树,询问两点间距离. Sol 倍增. 方向没用. 没有然后了. Code ...
分类:
其他好文 时间:
2016-11-10 07:48:05
阅读次数:
200
Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals ...
分类:
其他好文 时间:
2016-11-10 03:16:24
阅读次数:
184
码畜的救赎: [抽象] abstract class Controller : ControllerBase, IActionFilter, IAuthorizationFilter, IDisposable, IExceptionFilter, IResultFilter, IAsyncContr ...
分类:
其他好文 时间:
2016-11-08 19:48:55
阅读次数:
172