1、需求创建一个函数,接受一个数字(0-9),返回该数字相应的英文名称2、方法一// global scope...var names = ['zero','one','two','three','four','five','six','seven','eight','nine'];var digi...
分类:
其他好文 时间:
2014-09-29 18:05:41
阅读次数:
169
八数码问题。
BFS+康托展开。康托用来判重。直接搜的的话会超时。需要预处理。
我就用结构体存了一个状态。
struct lx
{
int can;//当前状态的康托展开
int pcan;//上一状态的康托展开
int k;//移动方向
};
把所有的 181442 种状态存下来。排序,然后二分搜索。迭代寻找上一状态,直到初始的 0 。
...
分类:
其他好文 时间:
2014-09-16 17:21:40
阅读次数:
181
Problem A
The Most Distant State
Input: standard input
Output: standard output
The 8-puzzle is a square tray in which eight square tiles are placed. The remaining ninth square is uncovered. Eac...
分类:
其他好文 时间:
2014-09-12 17:16:43
阅读次数:
203
八数码问题。BFS+康托展开
很经典的题。问你怎么移动恢复到初始状态。
一开始上下左右的方向搞错了,而且因为是多种答案(Special Judge)所以WA了好几次,于是一步一步打印出来。终于对了。
跑了360ms。ORZ 0ms的大神。 交HDU 的 1070 就无限TLE 。继续优化好了。(自认为自己的逆康托展开写得不好)
#include
#inclu...
分类:
其他好文 时间:
2014-09-11 11:19:01
阅读次数:
270
题目如下:
Problem A
The Most Distant State
Input: standard input
Output: standard output
The 8-puzzle is a square tray inwhich eight square tiles are placed. The remaining ninth square is uncove...
分类:
其他好文 时间:
2014-09-07 13:35:55
阅读次数:
284
经典的八数码问题,用来练习各种搜索=_=。这题我用的A*做的,A*的主要思想就是在广搜的时候加了一个估价函数,用来评估此状态距离最终状态的大概距离。这样就可以省下很多状态不用搜索。对于每个状态设置一个函数 h(x),这就是估价函数了(可能名词不太对请见谅),再设置一个函数 g(x), 这存的是初.....
分类:
其他好文 时间:
2014-08-31 17:13:11
阅读次数:
345
Problem 31
In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation:
1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p).
It is possible to ...
分类:
其他好文 时间:
2014-08-21 11:30:04
阅读次数:
169
Speech Module 1 FIRST_TEN = ["one", "two", "three", "four", "five", "six", "seven", 2 "eight", "nine"] 3 SECOND_TEN = ["ten", "eleven", "...
分类:
其他好文 时间:
2014-08-05 10:49:49
阅读次数:
218
#include#include#includechar *g_WordTable[10]= {"zero", "one", "two", "three", "four", "five","six", "seven", "eight", "nine"};int main(){ //存放用户输入...
分类:
其他好文 时间:
2014-08-02 12:31:53
阅读次数:
530
ioctl.h 分析
我自己画了个解析图。。。不要嫌弃丑啊。。。哈哈
type
The magic number. Just choose one number (after consultingioctl-number.txt ) and use it throughout the driver. This field is eight b...
分类:
其他好文 时间:
2014-08-01 10:55:41
阅读次数:
234