Unique PathsA robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right a...
分类:
编程语言 时间:
2014-08-25 06:33:53
阅读次数:
277
SPOJ Problem Set (classical)7001. Visible Lattice PointsProblem code: VLATTICEConsider a N*N*N lattice. One corner is at (0,0,0) and the opposite one ...
分类:
其他好文 时间:
2014-08-24 20:42:43
阅读次数:
146
这个题卡在不知道怎么判是否转弯,不过看了大神的解题就懂了,程序里的(dir!=-1 && i!=dir)就是用来判断是否转弯了。
本题我是用的dfs,找到终点时并不晕就返回真,程序并没有遍历整个图。并且在走重时会根据在重点的转弯是turn判断以选优,
这在程序中操作,并作为剪枝,注意本题剪枝很重要,不然会超时的。
下面俩解释一下bfs()中if()剪枝中为什么相等的情况不能剪掉(先看代码去)...
分类:
其他好文 时间:
2014-08-24 14:15:32
阅读次数:
311
http://duartes.org/gustavo/blog/post/how-the-kernel-manages-your-memory/After examining thevirtual address layoutof a process, we turn to the kernel a...
分类:
其他好文 时间:
2014-08-23 16:40:51
阅读次数:
471
BOOL BitBlt(
HDC hdcDest, // handle to destination device context
int nXDest, // x-coordinate of destination rectangle's upper-left
// corner
int nYDest, // y-coordinate of des...
分类:
其他好文 时间:
2014-08-21 22:52:35
阅读次数:
316
Android实现iphone样式的对话框,主要是借助shape,corner元素方法。下面的circular_corner_dialog.xml文件定义了一个圆角矩形。corner元素指定了圆角矩形的圆角半径,而gradient元素则指定了色彩渐变的方向以及起始颜色。当然也可以使用shape创建其...
分类:
移动开发 时间:
2014-08-19 18:24:45
阅读次数:
243
Given an absolute path for a file (Unix-style), simplify it.For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c"Corner Cases:Did...
分类:
其他好文 时间:
2014-08-18 17:53:22
阅读次数:
205
网格路径问题,中文翻译如下:
从 22的格子的左上角开始,只允许向右和向下移动,一共有六种路径可以抵达右下角
那么在2020的路径中一共有多少条这样的路径?
原题如下:
Starting in the top left corner of a 22 grid,
and only being able to move to the right and down...
分类:
编程语言 时间:
2014-08-18 16:33:02
阅读次数:
232
一,初步设想 让两个进程实现同步与互斥访问临界资源。 伪代码:turn 。。0 1P0while turn=1 do{nothing}turn := 1P1while turn=0 do{nothing}turn := 1问题: turn 为0时,进程P0在进入临界区前(在临界区外),如果发生...
分类:
其他好文 时间:
2014-08-18 14:19:42
阅读次数:
214
Treblecross is a two player gamewhere the goal is to get three X in a row on a one-dimensional board. At the startof the game all cells in the board is empty. In each turn a player puts a X in an empt...
分类:
其他好文 时间:
2014-08-17 17:03:33
阅读次数:
358