类似于八数码的一道经典搜索题,思路基本也一样.我是用康拓展开进行的判重.代码如下:/*
ID: 15674811
LANG: C++
TASK: msquare
*/#include
#include
#include
#include
#include
using namespace std;#define...
分类:
其他好文 时间:
2015-05-19 10:37:24
阅读次数:
156
康拓展开?双向Bfs?
no,no,no,简单单向bfs+map判重就好,不过预处理的思想是不变的。
不过我看了许多博客,也没人解释为何12345678可以达到其他所有的状态
#include
#include
#include
using namespace std;
string st,ed;
mapmapp;
map::iterator it;
struct stu
{
s...
分类:
其他好文 时间:
2015-05-18 09:05:27
阅读次数:
127
魔板
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 2139 Accepted Submission(s): 452
Problem Description
在魔方风靡全球之后不久,Rubik先生发明了它...
分类:
其他好文 时间:
2015-04-25 00:20:40
阅读次数:
124
问题描述 如下面第一个图的九宫格中,放着 1~8 的数字卡片,还有一个格子空着。与空格子相邻的格子中的卡片可以移动到空格中。经过若干次移动,可以形成第二个图所示的局面。 我们把第一个图的局面记为:12345678. 把第二个图的局面记为:123.46758 显然是按从上到下,从左到右的顺序记...
分类:
其他好文 时间:
2015-03-19 23:31:36
阅读次数:
269
#codeforce 285 div2 D 题解 ##说明 这道题目是看了思路分析才知道的,关键问题在于数据量过大,需要快速检索的同时不能辅助空间过大. 因此利用了下面3种方法结合解决该问题 - 康拓展开与逆康拓展开 - 树状数组 ...
分类:
其他好文 时间:
2015-01-30 00:11:52
阅读次数:
263
Subset sequence
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3441 Accepted Submission(s): 1740
Problem Description
Consider the a...
分类:
其他好文 时间:
2015-01-19 01:43:36
阅读次数:
238
Problem 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 sliding tiles, each with a number from 1 to 1...
分类:
其他好文 时间:
2014-12-25 01:28:24
阅读次数:
300
1.康托展开的解释
康托展开就是一种特殊的哈希函数
把一个整数X展开成如下形式:
X=a[n]*n!+a[n-1]*(n-1)!+...+a[2]*2!+a[1]*1!
其中,a为整数,并且0
{1,2,3,4,...,n}表示1,2,3,...,n的排列如 {1,2,3} 按从小到大排列一共6个。123 132 213 231 312 321 。...
分类:
其他好文 时间:
2014-12-24 00:03:22
阅读次数:
189
前言说到集合就不得不提到康拓,虽说集合论对现代数学有着非常大的影响,但总是对他的无限集的理论有一些疑问(不知道是不是叫无限集,反正我是这么叫)。最简单的例子就是一个平面上点的数量与一条直线上点的数量一样多(这是人第一次听到都会觉得不对吧)。该问题普遍的解释一般是说这两者的元素之间有一一对应的关系(好...
分类:
其他好文 时间:
2014-08-23 22:49:21
阅读次数:
296
Problem Description
Eight-puzzle, which is also called "Nine grids", comes from an old game.
In this game, you are given a 3 by 3 board and 8 tiles. The tiles are numbered from 1 to 8 and each ...
分类:
其他好文 时间:
2014-07-21 16:22:02
阅读次数:
264