算法
文章平均质量分 71
CodeMasterShiller
一个老码农
展开
-
关灯游戏
<br />from http://topic.csdn.net/t/20050119/10/3737122.html<br /> <br /> <br />有一个5*6的灯泡构成的矩阵,灯的开关规则是这样:当改变某盏灯的,状态时,这盏灯的上下左右相邻的灯的状态也随之改变。例如: <br />0 1 1 0 1 0 <br />1 0 0 1 1 1 <br />0 0 1 0 0 1 <br />1 0 0 1 0 1 <br转载 2010-07-04 10:47:00 · 1209 阅读 · 0 评论 -
八皇后问题解法
<br />#include <stdio.h>#include <list>using std::list;int selcol(int* board, int dim, int row, int initcol){ for (int i=initcol; i<dim; ++i) { int j; for (j=0; j<row; ++j) { if (*(board+j*dim+i) != 0) break; if (i-(r原创 2010-07-30 13:54:00 · 772 阅读 · 1 评论 -
如何将彩色图片转换成灰白图片
<br /> <br />http://desktoppub.about.com/od/scanninggraphics/ss/color_to_bw_3.htm<br />Corel Photo-Paint: Image > Convert to... > Grayscale (8-bit) <br />Adobe Photoshop: Image > Mode > Grayscale <br />Adobe Photoshop Elements: Image > Mode > Grayscale (sa原创 2010-08-17 11:53:00 · 3425 阅读 · 0 评论 -
carp协议
http://icp.ircache.net/carp.txt 对url做hash For (each char in URL): URL_Hash += _rotl(URL_Hash, 19) + char ; 对proxy做hash For (each char in MemberProxyName): MemberProxy_Hash += _转载 2011-06-16 22:53:00 · 1571 阅读 · 0 评论