Description The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 slidin ...
分类:
其他好文 时间:
2016-07-23 00:33:31
阅读次数:
204
求随机dfs序的期望。 我们来看到一个点之后是什么情况。 一个点p有很多儿子,其中一个是x; 如果要求x的期望,那么先看: 如果从父亲直接到这个点,那就是父亲的期望加一; 如果还走其他的点,那么最后一步肯定还是要加一(因为你总要花一步从别的店跳过来),所以无论怎样都要父亲的期望加一。剩下来再看,如果 ...
分类:
其他好文 时间:
2016-07-22 21:13:27
阅读次数:
186
7.17 HDU 5456 Matches Puzzle Game 没有最丑只有更丑。 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <algorithm> 5 using namespace st ...
分类:
其他好文 时间:
2016-07-18 02:45:45
阅读次数:
241
Description Katu Puzzle is presented as a directed graph G(V, E) with each edge e(a, b) labeled by a boolean operator op (one of AND, OR, XOR) and an ...
分类:
其他好文 时间:
2016-07-15 19:58:08
阅读次数:
159
这题应该算是经典的八数码问题的弱化版吧:给你一个4x2的方版,上面有0-7 八个数字,每次只能让编号0的方格跟他的上下左右的方格交换;所以也就是把方格0当做空格看待,每次只有空格周围的方格能够向空格处移动。 然后问从输入的方格样式变换到字典序最小的"01234567" 最少需要多少次。 解法是用bf ...
分类:
其他好文 时间:
2016-07-15 13:30:43
阅读次数:
218
Time Limit: 1000MS Memory Limit: 10000KB 64bit IO Format: %I64d & %I64u Description Some of the secret doors contain a very interesting word puzzle. T ...
分类:
其他好文 时间:
2016-07-12 23:21:28
阅读次数:
191
Partychen invents a new game named “Eleven Puzzle” .Just like the classic game “Eight Puzzle”,but there some difference between them:The shape of the ...
分类:
其他好文 时间:
2016-07-08 10:16:22
阅读次数:
166
Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character '.'. You may assume that there will be ...
分类:
其他好文 时间:
2016-07-06 23:32:14
阅读次数:
356
有关递归与分治的几个问题: Q1:有一个2^k * 2^k的方格棋盘,恰有一个方格是黑色的,其他为白色的。你的任务是用包含3个方格的L型牌覆盖所有白色方格。黑色方格不能被覆盖,且任意一个白色方格不能同时被两个或更多牌覆盖。 分析:这道问题我们在《algorithm puzzle》一书的专栏中曾经有过 ...
分类:
其他好文 时间:
2016-06-25 09:38:51
阅读次数:
128
这一章节主要介绍我们在进行数值分析常用的二分、三分策略。 首先介绍二分。 其实二分的思想很好理解并且笔者在之前的一些文章中也有所渗透,对于二次函数甚至单元高次函数的零点求解、线段树还有《algorithm puzzle》当中的“切割钢条”问题,都是基于二分思想。 下面我们通过具体的问题来应用二分这种 ...
分类:
编程语言 时间:
2016-06-21 12:18:23
阅读次数:
172