A. A and B and Chess题意:给出8*8的棋盘,大写的字母代表白方,小写的字母代表黑方,比较两方分别的权值多少 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 char s...
分类:
其他好文 时间:
2015-03-02 22:14:14
阅读次数:
192
在一个2^k×2^k (k≥0)个方格组成的棋盘中,恰有一个方格与其他方格不同,称该方格为特殊方格。显然,特殊方格在棋盘中可能出现的位置有4^k种,因而有4^k种不同的棋盘,图4.10(a)所示是k=2时16种棋盘中的一个。棋盘覆盖问题(chess cover problem)要求用图4.10(b)所示的4种不同形状的L型骨牌覆盖给定棋盘上除特殊方格以外的所有方格,且任何2个L型骨牌不得重叠覆盖。...
分类:
其他好文 时间:
2015-03-02 19:06:09
阅读次数:
113
这个题目感觉略简单,但是后两题还是一个没做出来╮(╯_╰)╭A. A and B and Chess就是比较一下棋盘上两边的权重。 1 #include 2 using namespace std; 3 4 const int maxn = 10; 5 6 char s[maxn][maxn]...
分类:
其他好文 时间:
2015-03-01 21:00:04
阅读次数:
188
题目大意给出一个8*8的矩阵包含黑白色块,问最少操作几次可以恢复白色。解题思路水题,记录下行和列黑块的个数,进行操作即可。...
分类:
其他好文 时间:
2015-03-01 14:29:51
阅读次数:
137
Problem Description
Let's design a new chess game. There are N positions to hold M chesses in this game. Multiple chesses can be located in the same position. The positions are constituted as a topological graph, i.e. there are directed edges connecting so...
分类:
其他好文 时间:
2015-03-01 13:14:04
阅读次数:
294
题目描述
Happy Spring Festival everyone! Many relatives will visit your house, of course they have bear kids. Now you are playing chess with a bear kid.
It's really terrible. You have a 3*3 chessboard...
分类:
其他好文 时间:
2015-02-28 21:41:43
阅读次数:
232
题意:玩飞行棋,棋盘有0~n共n+1,每次抛一个6面的骰子,若得到x(1= n时,游戏结束。求抛骰子次数的期望。
解释概率dp加上一个限制条件,说下为什么当有飞机的时候前面的等于后面的,因为dp代表的是当前位置到n的期望, 所以前面的概率等于飞机到达的
转载:
又一道期望DP,其实这题与hdu4576那道概率DP很像(这道我也写了题解)。那么这两道一道求概率,...
分类:
其他好文 时间:
2015-02-27 06:41:56
阅读次数:
124
听了下别人的讲解后,最后仔细理解了下所谓的八皇后问题。
怎么说呢,感觉有点像搜索的做法。
#include
int count=0;
//row行,j列;
int notDanger(int row,int j,int (*chess)[8]){
int i,k,flag1=0,flag2=0,flag3=0,flag4=0,flag5=0;
//注意这里row与j不能直接使用;
...
分类:
其他好文 时间:
2015-02-25 17:10:10
阅读次数:
147
所谓概率DP大多是算期望 算期望大多是从终点往回推
分类:
其他好文 时间:
2015-02-17 12:47:44
阅读次数:
122
八皇后问题八皇后问题#include const int N = 8;int count;int notdanger(int row, int c, int (*chess)[N]) {// i 和 j 是 行列下标,一直扫 // 列 for (int i = 0; i = 0 && j >= 0;...
分类:
其他好文 时间:
2015-02-13 23:35:39
阅读次数:
260