未来心不可得
December 25, 2017

划分树

算是线段树的一种变形线段树维护每个element的绝对位置不变。划分树维护每个element保持相对位置。教程 网上去搜https://njzwj.github.io/2017/06/29/partition-tree-notes-1/话说 挺喜欢这种自建blog,对于什么网易 新浪 等等。。广告太影响阅读流程线段树结构SegTree,初始化时候直接下放到底。其中lccnt 表示到i位置(包...
December 21, 2017

一种不知道对不对的exact cover solution.

这是个NPC问题先来看经典的Dancing Links先看中文翻译,直到Four-way-linked插图,然后请看英文版pdf,结合代码,在pdf上用画笔抹一抹,就明白了。粘链接中文DLXcn翻译、及英文pdf在这里https://github.com/sqybi/DLXcnjava代码看这里 http://blog.gssxgss.me/use-dlx-to-solve-sudoku-1...
December 19, 2017

Quick Sort 和 Quick Sort

序这是一个历史遗留问题下文有两个函数 qsort和qsort2,其中qsort是对的,而qsort2会tle/wa?。。。直到现在还不知道是哪里的事儿。。囧rzTemplate#include <iostream> using namespace std; int a[100]={1,2,3,8,6,3,1,4,2,9,9,9,1}, n=13; void qsort2(int ...
December 13, 2017

博弈论与Nim游戏的SG函数

很有趣,看了许多资料,回忆起了好多。博弈论不妨想像成一个棋盘,只有一个人来玩。(但是必胜/必败还是指的两人交替)N-Position 当前state必胜。P-Position 当前state必败。因此,任意一种state只能是P/N两种局面。N-Position == It have a chance into P-Position state at the next step, any c...
December 5, 2017

Hungarian Algoritim Template.

For Bipartite Graph..We Named left Node by 0,1,2,3,4,5...And the Right Node's names are also 0,1,2,3,4,5...For each time we call dfs(), we always stand on the left side, to watch the right side.Tem...