刚做了两道Two Sigma OA。 还是两道老题, Friend Cycle和Longest Chain。 Friend Cycle可以用Union Find来做。优化的时候因为矩阵是沿对角线对称,所以可以只扫描一半的元素,也可以加上Path Compresssion和 weight。 Longe
分类:
其他好文 时间:
2016-02-08 13:32:51
阅读次数:
382
Our application was able to produce write effects, through sinks, and was able to receive read effects, through the DOM sources. However, the main fun
分类:
Web程序 时间:
2016-02-04 18:48:46
阅读次数:
201
题目链接:uva 1561 - Cycle Game 题目大意:给出一个环,每次从起点開始,能够选择一个权值非0的边移动,移动后减掉权值至少1点。不能移动的为失败。 解题思路: 1:有0的情况,假设有方向离权值为0的边的步数为奇数,则为必胜。否则必败。2:无0的情况,奇数边必胜;3:有1的情况。同0
分类:
其他好文 时间:
2016-02-04 13:19:51
阅读次数:
127
题目是遇到偶数/2,遇到奇数 *3 + 1的题目,然后找一个range内所有数字的max cycle length。对于一个数字,比如说44,按照题目的公式不停计算,过程是 44, 22, 11, 8, 9 ,1(瞎起的),从44到1的这个sequence的长度,叫做cycle length。然后题
分类:
其他好文 时间:
2016-02-04 06:42:50
阅读次数:
196
So far we only had effects that write something to the external world, we are not yet reading anything from the external world into our app. This less
分类:
Web程序 时间:
2016-02-03 00:16:20
阅读次数:
225
Currently the code looks like : // Logic (functional) function main() { return { DOM: Rx.Observable.timer(0, 1000) .map(i => `Seconds elapsed ${i}`),
分类:
Web程序 时间:
2016-02-02 17:54:08
阅读次数:
211
How can we show one string on the DOM, and a completely different string on Console log? This lesson shows how we can make our main function return mu
分类:
Web程序 时间:
2016-02-02 07:31:44
阅读次数:
133
概述 ASP.NET 平台定义了两个非常重要的生命周期。第一个是 应用生命周期 (application life cycle),用来追踪应用从启动的那一刻到终止的那一刻。另一个就是 请求生命周期 (request life cycle),它定义了 HTTP 请求在 ASP.NET 平台中首次接收到
分类:
Web程序 时间:
2016-01-29 20:06:46
阅读次数:
375
The guiding principle in Cycle.js is we want to separate logic from effects. This first part here was logical, and this second part here was effects. ...
分类:
Web程序 时间:
2016-01-26 20:15:27
阅读次数:
177
One of the features merged in the 3.9 development cycle was TCP and UDP support for theSO_REUSEPORTsocket option; that support was implemented in a se...
分类:
其他好文 时间:
2016-01-26 10:32:38
阅读次数:
188