Description In mathematics, the four color theorem, or the four color map theorem, states that, given any separation of a plane into contiguous region ...
分类:
其他好文 时间:
2016-10-09 19:47:26
阅读次数:
218
题目链接:Around the World 题意: 给你n个点,有n-1条边,现在这n-1条边又多增加了ci*2-1条边,问你有多少条欧拉回路 题解: 套用best定理 Best Theorem:有向图中以 i 为起点的欧拉回路个数为以 i 为根的树形图个数 ×(( 每个点 度数 ?1)!)。 Ma ...
分类:
其他好文 时间:
2016-10-02 21:36:06
阅读次数:
180
Hello,我就是人见人爱,花见花开,蜜蜂见了会打转的小花。。哈哈,我们终于讲到了当年大学让我头痛不已的贝叶斯。先给个模型: 一:贝叶斯定理 维基百科定义:贝叶斯定理(英语:Bayes' theorem)是概率论中的一个定理,它跟随机变量的条件概率以及边缘概率分布有关。在有些关于概率的解说中,贝叶斯 ...
分类:
编程语言 时间:
2016-09-13 11:32:29
阅读次数:
210
①Landau's Theorem 比赛得分问题 ②a%b <= a/2(a >= b) 一:Landau's Theorem https://en.wikipedia.org/wiki/Tournament_%28graph_theory%29 有n个人,每个人之间比一场比赛,赢的+1,输的为0, ...
分类:
其他好文 时间:
2016-09-11 20:10:44
阅读次数:
121
1006 Football Games 这道题输入也很阴险!!! 这道题过题姿势最优雅的,不是if else if else if。那样很容易wa的。 如果没有平手选项, 赢得加一分的话, 可以用Landau's Theorem(兰道定理)判定。 稍微修改一下这个定理就能做了。 假设S1,S2……S ...
分类:
其他好文 时间:
2016-09-11 18:29:44
阅读次数:
152
Description Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triple ...
分类:
其他好文 时间:
2016-08-22 00:13:01
阅读次数:
220
Description Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triple ...
分类:
其他好文 时间:
2016-08-21 13:58:54
阅读次数:
158
传送门Katya studies in a fifth grade. Recently her class studied right triangles and thePythagorean theorem. It appeared, that there are triples of positive integers such that youcan construct a right tri...
分类:
其他好文 时间:
2016-08-21 11:09:29
阅读次数:
202
Pythagorean Triples Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there ar ...
分类:
其他好文 时间:
2016-08-21 00:38:25
阅读次数:
160
题目链接:点击打开链接
思路:
用d[i][j]表示前i个字符,已经匹配了字母中的j个字符,最终包含这个字母的概率。
每次转移的时候有n个方向, 表示第i个字符选哪个字符, 那么有个问题, 如果我当前选的这个字符失配了, 那么转移之后我还匹配了多少个字符。 这恰恰是KMP能做的。
细节参见代码:
#include
#include
#include
#include
#inclu...
分类:
其他好文 时间:
2016-08-03 20:30:18
阅读次数:
185