自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Mr.CJ

Thinking Deeper,Run Further...

  • 博客(28)
  • 资源 (5)
  • 收藏
  • 关注

原创 水题 hdu 1070 milk

http://acm.hdu.edu.cn/showproblem.php?pid=1070#include/*读题不慎,WA了一次*/int main(){ char name[101][100]; int t,n,i,k=0; int a[101],b[101],bb[111]; scanf("%d",&t); while(t--)

2012-02-29 23:34:18 527

原创 bfs hdu 1252 Hike on a Graph--easy

http://acm.hdu.edu.cn/showproblem.php?pid=1252#include#include#include#includeusing namespace std;/*easy bfs*/struct node{ int x[3];}p;int maze[55][55],m,vis[55][55][55];vo

2012-02-29 22:48:07 653

原创 dp 水题 hunnu 10108 Entry

http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=10108dp[i]表示有i辆车时的结果则dp[i]=dp[i-1]*m+dp[i-1]*(i-1)  表示第i辆车可放在最后或者是前i-1辆车中某一辆的前面一个位置初始化dp[1]=m;#include#includeusing namespac

2012-02-28 18:22:11 382

原创 数学 hnu 12256 Rabbit Playing Game

http://acm.hnu.cn/online/?action=problem&type=show&id=12256#include#include#includeusing namespace std;/*排序后,则a[i]可以放在a[p](i>p>=0)的前面,累乘即可了*//*尼玛的这题太坑爹了,说是N*/const int MAX=

2012-02-28 12:41:34 313

原创 水题 hdu 1391 Number steps

http://acm.hdu.edu.cn/showproblem.php?pid=1391#includeint solve(int a,int b){ int s=1,i; if(a==0) { if(b==0) return 0; return -1; } if(a==1)

2012-02-27 01:27:02 359

原创 dfs hdu 1518 square

http://acm.hdu.edu.cn/showproblem.php?pid=1518#include#include#includeusing namespace std;int a[20],m,flag,sum,side;bool f[20];//注意搜索策略,之前没有用p来记录,每次for()都从i=0开始导致TLE//sum 剩余边的总和

2012-02-27 00:52:05 562

原创 bfs hdu 1732 push the box

http://acm.hdu.edu.cn/showproblem.php?pid=1732#include#include#include#includeusing namespace std;/*和hdu 1254相比这题虽然3个箱子,但是求人的最少路径只要一个bfs就可以,只要标记量开8维数组,注意一下推箱子的过程就可以了注意题意:虽说@表示hole,但是可

2012-02-26 21:58:12 578

原创 bfs+bfs/dfs hdu 1254 推箱子1

http://acm.hdu.edu.cn/showproblem.php?pid=1254推箱子#include#include#include#include/*BFS+BFS/DFS,第二个用于判断是否能移动到可以推得位置,因为矩阵很小所以就DFS也不担心 TLE了,注意第二组数据,箱子路径可能会重复,所以标记vis要开思维同时记录箱子和人的位置

2012-02-25 17:22:31 534

原创 bfs+hash poj 1077/hdu 1043 八数码问题

Y的,若不吐槽天理不容了。一看这题,有点不敢做,主要是状态不好记录,以前做迷宫的从来没有将整个状态存入每个结构体的节点中,这对于是否访问过的记录就很耗时,不过这里只是长度为9的数组,转换成字符串也可以理解。然后就开始用上set了,果断就超时了,然后就傻眼了。百度之后发现新大陆,全排列逆序对的东西真是强大,好多hash的喜悦心情让我继续做下去,我~~去,又是TLE,难道是因为我顺便每个节点都保存

2012-02-22 02:28:40 1036

原创 字符串 gets(),最恨字符串神么的了

#includeusing namespace std;int main(){ char ss[30],st[3]; scanf("%s",ss); cout<<ss<<endl; /* //注意这里getchar()的重要性,若是没有,上面ss输入换行,st的输入也被结束了,即st成了空串 输入asd然后回车,没有getchar()时以为这个回车结束了

2012-02-21 20:39:49 470

原创 bfs hdu 1026

http://acm.hdu.edu.cn/showproblem.php?pid=1026#include#include#include#include/*bfs ,priority_queue according the steprecord the path*/using namespace std;const int N = 100;char maze

2012-02-20 06:30:54 433

原创 Murphy's Laws

If there are two or more ways to do something, and one of those ways can result in catastrophe,then someone will do it.根据墨菲定律:一、任何事都没有表面看起来那么简单  二、所有的事都会比你预计的时间长三、会出错的是总会出错四、如果你担心某种情况发生,那么

2012-02-19 01:25:07 425

原创 bfs fzu 1205 小鼠迷宫

http://acm.fzu.edu.cn/problem.php?pid=1205朴素BFS,然后求最短路的数目,再次BFS即可,注意一个结点只入队一次#include#include#include#includeusing namespace std;struct node{ int x,y; node(int a=0,int b=0)

2012-02-15 20:14:13 408

原创 bfs poj 2157 maze

http://poj.org/problem?id=2157#include#include#include#include/*这里只要判断yes or no,故BFS所有能到达的位置,只要注意当出队的是门时,若不能打开,则不做操作让门重新入队,避免死循环,这里用limit进行限制*/using namespace std;struct node{ in

2012-02-15 18:57:33 582

原创 BFS poj 3026 Borg Maze

http://poj.org/problem?id=3026粘一段百度到的翻译,当时真心 的没看懂英文 Borg是银河系的一种无比强大的类人生物, 现在要求计算Borg同化整个迷宫中所有individual的最小代价. 当Borg在起点或是当一个individual被同化时, 群体可以分裂成若干个子群体. 搜索迷宫的代价为参与搜索的所有群体走过的步数和.

2012-02-14 13:12:08 484

原创 奇偶校验码

看操作系统时,“当主存的奇偶校验装置发现主存读写错误时”,表示不懂什么是“奇偶校验”,以下来自http://www.elecfans.com/dianzichangshi/2009101396337.html奇偶校验码是一种开销最小,能发现数据代码中一位出错情况的编码,常用于存储器读写检查,或ASCII字符、其它类型信息传送过程中的出错检查。它的实现原理,是使原来合法编码码

2012-02-14 00:42:06 1266

原创 模拟 hdu 1103 Flo's Restaurant

http://acm.hdu.edu.cn/showproblem.php?pid=1103模拟,优先级队列,注意等待的情况,若值得等待,则被等的人出队,保持时间的连续性#include#include#includeusing namespace std;int main(){ int a,b,c,ta[3],h,min,ti,diners,res

2012-02-13 21:19:59 1304 1

原创 bfs hdu 1728 逃离迷宫

http://acm.hdu.edu.cn/showproblem.php?pid=1728#include #include#include#includeusing namespace std;/*刚开始就DFS,果断TLE了,不会剪枝,其实也不知道怎样BFS,百度了一下,我擦,恍然大悟,一条道走到黑呗,注意vis[][]的更新*/const int N=100;

2012-02-13 19:12:42 450

原创 BFS hdu 1072 Nightmare

http://acm.hdu.edu.cn/showproblem.php?pid=1072#include#include#include#include#include/*求最短步数,BFS,剪枝的时候注意,这里有时间的限制,故用vis[x][y][time]三维数组来标记*/using namespace std;struct node{ int x

2012-02-13 13:36:54 367

原创 dfs hdu 1242

http://acm.hdu.edu.cn/showproblem.php?pid=1242#include//DFS ,再次体会对于搜索的优化,array mins[i][j],保存当前搜到//maze[i][j]的最优值,char maze[202][202];int vis[202][202],mins[202][202];int m,n,next[4][2]={1,

2012-02-12 21:43:18 620

原创 DFS 剪枝 hdu 1010

http://acm.hdu.edu.cn/showproblem.php?pid=1010/*if calculate the minimum step by BFS,it will get TLE ,too.学习了新东西,先奇偶性判断迷宫看成0 1交错的格子,从0到1要奇数步,0到0要偶数步。体会剪枝的重要性*/#include#include#include#in

2012-02-12 12:28:49 521

原创 数论 hdu_1239

http://acm.hdu.edu.cn/showproblem.php?pid=1239/*p,q的范围其实可在2—50000(why?)然而,这是最小的范围吗?考虑大于10000的某个质数,不妨设为Q,另一个质数为P,则:如果P<10,P/Q<0.001如果P>10,P*Q>100000而考虑到a,b的取值范围(1<=a<=b<=1000)可知min(a/b)=0.

2012-02-11 17:59:04 604

原创 搜索 hdu 1238

http://acm.hdu.edu.cn/showproblem.php?pid=1238找到最短的字符串,暴力搜索,STL轻松水过#include#include#include#includeusing namespace std;int main(){ int t,n,i,j; scanf("%d",&t); while(t--

2012-02-11 16:39:08 652

原创 DFS poj 2192 zipper

题目 http://poj.org/problem?id=2192#include#includechar a[202],b[202],c[404];int la,lb,lc;int dfs(int L1,int L2,int L3){ if(L1==la&&L2==lb) return 1; if(L1<la&&a[L1]==c[L3

2012-02-11 15:29:44 345

原创 纠结N日谈 cpu占用率100%

莫名其妙的,电脑开机cpu占用率 100%,查看进程,开机启动的有道占了50%,安全卫士占了50%。结束了他们之后,开QQ占一半,搜狗浏览器占一半。我擦,反正就是要做什么事情就只能开相应的进程,不过看在谷歌chrome正常的情况下,我还是心存侥幸。软件卸了好多,都是流氓啊,写完了还残留了那么多东西,手工删除的想死。机壳拆了清理了灰尘,售后检测了硬件,问题依然没有得到解决。难不成还得听从最初的建议重

2012-02-10 23:59:57 390

原创 poj_1182 食物链、并查集

poj_1182 食物链参考解题http://wenku.baidu.com/view/d94699d8a58da0116c17496e.htmlr[x]表示x与集合的代表元素之间的关系,0:同类; 1,被吃; 2 吃#include#includeusing namespace std;int father[50001],r[50005];int getf

2012-02-09 20:15:48 376

原创 NYOJ_47 过河问题,贪心选择

http://acm.nyist.net/JudgeOnline/problem.php?pid=47在漆黑的夜里,N位旅行者来到了一座狭窄而且没有护栏的桥边。如果不借助手电筒的话,大家是无论如何也不敢过桥去的。不幸的是,N个人一共只带了一只手电筒,而桥窄得只够让两个人同时过。如果各自单独过桥的话,N人所需要的时间已知;而如果两人同时过桥,所需要的时间就是走得比较慢的那个人单独行动时所需的

2012-02-07 18:31:29 3285

原创 For My Future 铁铮铮的汉子(修改篇)

设置QQ个性签名   I am Mr. Simple…2012祈愿,做安静的人,做个性情中人,做铁铮铮的汉子删。。。。。。于2012/4/29

2012-02-06 04:55:05 526

tts语音引擎修复补丁win7 官方最新版

tts语音引擎修复补丁win7 官方最新版

2022-09-09

C语言趣味程序百例精解.rar

C语言趣味程序百例精解.rar

2012-03-08

W3School全套教程.CHM

这是我下载的最好用的一个W3School全套教程.CHM

2012-03-08

algorithm_头文件_说明

algorithm algorithm STL 算法 algorithm_头文件_说明 algorithm algorithm STL 算法 algorithm_头文件_说明 algorithm algorithm STL 算法 algorithm_头文件_说明

2011-06-03

[趣味程序导学Visual.Cpp].董未名.文字版

趣味程序导学Visual.Cpp].董未名.文字版pdf 趣味程序导学Visual.Cpp].董未名.文字版pdf

2011-05-09

数据结构串的堆分配存储表示

数据结构中串的堆分配表示,包括复制和插入两个操作,其余的领会精神,在此不多叙述,注意,要初始化

2011-04-11

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除