- 博客(20)
- 资源 (17)
- 收藏
- 关注
原创 hdu 1253 胜利大逃亡(三维bfs)
Problem DescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,C-1)的位置,现在知道魔王将在T分钟后回到城堡,Ignatius每分钟能从一个坐标走到相邻的六个
2014-12-30 22:35:04 535
原创 hdu 1181 变形课(dfs)
Problem Description呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语是以a开头b结尾的一个单词,那么它的作用就恰好是使A物体变成B物体. Harry已经将他所会的所有咒语都列成了一个表,他想让你帮忙计算一下他是否能完成老师的作业,将一个B(
2014-12-30 20:31:06 487
原创 hdu 2553 N皇后问题(dfs)
Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。 Output
2014-12-30 19:59:23 473
原创 hdu 4016 Magic Bitwise And Operation(dfs)
Problem DescriptionGiven n integers, your task is to pick k out of them so that the picked number are minimum when do bitwise “AND” among all of them.For example, there are three integers 5, 6 a
2014-12-24 21:05:24 662
原创 二叉堆之优先队列
一、优先队列不同于普通队列采用先进先出的队列元素存取方式。插入队列元素时按照一定的规则插入,每次都是取队列中优先级最高的元素。在操作系统中,调度程序必须决定在什么时候运行哪个进程。一般来说,短的作业是需要尽可能快地完成,也就是说,短的作业应该拥有优先权。这种特殊的应用将由一种特殊的队列来完成,这种数据结构叫做优先队列。二、最基本的两种操作 优先队列具备的最基本的两种操作,是插入和
2014-12-22 21:41:54 611
原创 hdu 1258 Sum It Up
Problem DescriptionGiven a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For example, if t=4, n=6, and the list is [4,3,2,2,1,1],
2014-12-15 15:51:48 447
原创 hdu 2952 Counting Sheep
Problem DescriptionA while ago I had trouble sleeping. I used to lie awake, staring at the ceiling, for hours and hours. Then one day my grandmother suggested I tried counting sheep after I'd gone
2014-12-15 15:27:03 397
原创 hdu 1312 Red and Black
Problem DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adja
2014-12-15 14:57:36 359
原创 hdu 1518 Square
Problem DescriptionGiven a set of sticks of various lengths, is it possible to join them end-to-end to form a square? InputThe first line of input contains N, the number of test ca
2014-12-14 21:59:57 503
原创 hdu 5143 NPY and arithmetic progression
Problem DescriptionNPY is learning arithmetic progression in his math class. In mathematics, an arithmetic progression (AP) is a sequence of numbers such that the difference between the consecutiv
2014-12-14 20:01:15 685
原创 poj 1847 Tram(最短路径)
DescriptionTram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going out of the
2014-12-08 19:52:25 598
原创 poj 1837 Balance
DescriptionGigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance. It orders two arms of negligible weight and each arm's lengt
2014-12-07 23:22:27 466
原创 poj1745 Divisibility
DescriptionConsider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different arithmetical expressions that evaluate to different
2014-12-07 21:32:30 463
原创 poj 1426 Find The Multiple
DescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater tha
2014-12-05 21:59:39 403
原创 poj 2531Network Saboteur
DescriptionA university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the network into two subnetworks in order
2014-12-04 21:59:05 391
原创 poj 3628 Bookshelf 2(01背包,dfs)
DescriptionFarmer John recently bought another bookshelf for the cow library, but the shelf is getting filled up quite quickly, and now the only available space is at the top.FJ has N cows (1 ≤
2014-12-04 19:48:52 545
原创 hdu 2602 Bone Collector(01背包)
Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grav
2014-12-04 16:51:30 356
原创 poj 3624 Charm Bracelet(01背包)
Charm BraceletTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 24394 Accepted: 11007DescriptionBessie has gone to the mall's jewelry store and spies a
2014-12-04 16:29:36 541
原创 根据二叉树的前序和中序求解树
求解方法类似于根据中序和后序求解树根据前序把中序分为左右子树,然后依次递归。前序:ABCDEFG中序:CBDEAFG#include #include #include using namespace std;typedef struct node{ char data; struct node *rchild,*lchild;}BiTNode,
2014-12-02 20:25:04 602
原创 根据二叉树的中序和后序求解树
参考:http://blog.csdn.net/wuchuanpingstone/article/details/6860453中序遍历:CBDEAFG后序遍历:CEDBGFA(1)先根据后序遍历结果找出树的根结点A。(2)然后将中序遍历分成三部分 CBDE A FG。(3)同样将后序结果分成 CEDB GF A三部分(根据左右子树结点个数相等分)。
2014-12-01 22:13:53 1258
TCP-IP详解卷1:协议
2015-10-15
nasm中文手册
2015-03-12
STL源码剖析简体中文完整版清晰
2014-11-11
C++标准程序库
2014-11-10
ACM培训-动态规划
2014-11-10
取石子游戏_博弈
2014-11-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人