One of the tasks students routinely carry out in their mathematics classes is to solve a polynomial equation. It is, given a polynomial, sayX2- 4X+ 1,...
分类:
其他好文 时间:
2015-03-14 12:24:41
阅读次数:
186
1.题目描述:点击打开链接
2.解题思路:本题要求放置尽可能少的服务器,使得所有的客户端到最近的服务器的距离都不超过k。由于已经放置了一个服务器,不妨把它当做根结点,先把无根树转化为有根树,然后我们考虑最深的叶子,那么不难证明,该叶子结点的最优服务器的放置位置是它的k级祖先。这样本题的算法便不难想出:从最深的叶子开始枚举,并在它的k级祖先处放置一个服务器,同时标记该服务器能覆盖到的所有结点,这样...
分类:
其他好文 时间:
2015-03-14 09:40:44
阅读次数:
122
https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3914对L研究可以发现相当于黑-横白,黑-纵白,每个黑白都要被匹配到,其中黑的横纵各两次,很...
分类:
其他好文 时间:
2015-03-11 09:15:40
阅读次数:
176
https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2640http://www.spoj.com/problems/SPOINTS/en/htt...
分类:
其他好文 时间:
2015-03-11 09:14:33
阅读次数:
169
怪我比赛的时候想法太过于杂乱了。注重于区域的属性了。甚至还想用状态压缩或者是hash来描述分块的区域。其实我们的可以宏观的角度去审视这个问题。就是求分区的问题。那么我们完全可以标记边框的值为1。即不可行走。那么我们扫描整片区域。统计一个区域 。就用DFS把这整片区域给覆盖。然后继续扫描下去。离散化在...
分类:
其他好文 时间:
2015-03-09 01:42:38
阅读次数:
184
题意:多个模板串,一个文本串,求出那些模板串在文本串中出现次数最多。解法:AC自动机入门模板题。代码:#include #include #include #include #include #include #include #include #include #include #define M...
分类:
其他好文 时间:
2015-03-05 23:41:49
阅读次数:
155
C - Playing With Stones Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice UVALive 5059DescriptionYou and your frien...
分类:
其他好文 时间:
2015-03-04 14:20:13
阅读次数:
169
UVALive - 3026
Period
Time Limit: 3000MS
Memory Limit: Unknown
64bit IO Format: %lld & %llu
Submit Status
Description
For each prefix of a given string S wit...
分类:
其他好文 时间:
2015-02-20 09:45:52
阅读次数:
139
简单DP,dp[i][j]表示从第一个序列里取出i个和从第j个序列里取出j个的组合的最小值,可以从两个方向转移过来,每次转移加上已经出现过的且还没有出现完的字母的个数. O(n?m)O(n*m)的复杂度.
1625 Color LengthCars painted in different colors are moving in a row on the road as shown in Figu...
分类:
其他好文 时间:
2015-02-11 16:39:30
阅读次数:
194
#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;#define pii pair#d...
分类:
其他好文 时间:
2015-02-09 12:26:49
阅读次数:
117