- 博客(7)
- 资源 (2)
- 收藏
- 关注
原创 sicily 1151
大概思路跟1150的一样,数据量大了,我刚开始是用set来存已经变换过的魔板,结果TLE,后来网上查了一下,用康托,结果WA。。但是我又不知道错在哪。最后用set来存,AC了哦/* * 1150.cpp * * Created on: Dec 18, 2010 * Author: alfred */ #include #include #include #include #include using namespace std; struct step
2010-12-31 13:09:00 1611
原创 sicily 1152
<br />投机取巧,我是用深搜找出一条路径,然后。。。。。。。。<br />/* * 1152.cpp * * Created on: Dec 30, 2010 * Author: alfred */ #include <iostream> using namespace std; int num[30] = {10, 2, 13, 26, 15, 19, 27, 23, 12, 4, 8, 1, 25, 14, 1, 9, 5, 18, 29, 16, 24, 28
2010-12-31 13:04:00 990 3
原创 中后序--->前
<br />void makeTree() { cur = postorder.size() - 1; head = new node(postorder[cur]); int pos = inorder.find(postorder[cur]); cur--; bulidRight(pos + 1, inorder.size(), head); bulidLeft(0, pos, head); } void bulidLeft(int beg, int end, node*
2010-12-30 10:18:00 386
原创 1150. 简单魔板[Special judge]
bfs搞定/* * 1150.cpp * * Created on: Dec 18, 2010 * Author: alfred */ #include #include #include #include using namespace std; struct step { int status[8]; string step; }; int target[8]; const int init[8] = {1, 2, 3, 4, 8, 7,
2010-12-18 15:00:00 1912 1
原创 sicily 1135
这题一开始我是用dfs做的(可连续飞行却只算一步这条件引发的),后来改用dfs,做得很顺利,提交,WA。。郁闷了,想了好久也想不出,后来请教了阿樵,发觉原来是总飞行路程是不能超过D,不是每一次飞行不能超过D,进行修改,但是还是WA。。最后研究发现了一个point:飞行一格跟移动一格的区别,好吧。。又WA。。原来是原来的代码没改好,再交,AC了!!/* * test.cpp * * Created on: Dec 17, 2010 * Author: alfred */ #i
2010-12-18 13:45:00 1224 2
原创 双基回文数
<br />/* * test.cpp * * Created on: Dec 15, 2010 * Author: alfred */ #include <iostream> #include <string> using namespace std; bool judge(int b) { string a; int count = 0; for(int i = 2; i <= 10; i++) { int m = b; a.clear()
2010-12-15 12:59:00 940
原创 根据二叉树的先序遍历和中序遍历重构二叉树
<br />想法:分治,根据前序遍历来对中序遍历进行划分,分为左右子树<br />/* * test.cpp * * Created on: Dec 13, 2010 * Author: alfred */ #include <iostream> #include <string> using namespace std; struct node { char data; node* left; node* right; node(char data
2010-12-13 23:51:00 924
mail.jar, activation.jar, xerces.jar, xmlsec-1.2.1.jar
2011-11-29
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人