- 博客(10)
- 资源 (1)
- 收藏
- 关注
原创 POJ3087 Shuffle'm Up(模拟)
A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containing C chips. Ea...
2018-10-31 16:25:54 306 3
原创 POJ3126 Prime Path(BFS)
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of se...
2018-10-27 14:50:25 291
原创 POJ1426 Find The Multiple(BFS)
Given 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 than 200 and there...
2018-10-27 13:43:04 221
原创 POJ3279 Fliptile(DFS翻转经典问题)
Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate an M × N grid (1 ≤ M ≤ 15; 1 ≤ N ≤ 15...
2018-10-24 21:31:16 357
原创 【转载】 for循环中i++与++i的效率探究
原文链接:https://blog.csdn.net/zy1691/article/details/4849808?utm_source=blogxgwz1for(int i=0;i<=50;i++) 我们经常会使用这样的代码来做循环,一般在for循环中习惯于使用i++,却很少使用++i。虽然从代码执行的效果来看,它们并无任何区别,但是它们所生成的代码是有有所不同的。 i...
2018-10-24 20:01:12 238
原创 POJ3278 Catch That Cow(简单BFS)
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,0...
2018-10-24 19:13:38 174
原创 POJ2251 Dungeon Master(三维BFS)
You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south...
2018-10-24 19:07:27 191
原创 POJ1321棋盘问题(DFS)(简单搜索)
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n...
2018-10-19 21:55:28 207
原创 IsPopOrder(栈的应用)
时间限制:5000ms单点时限:1000ms内存限制:256MB描述输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否可能为该栈的弹出顺序。假设压入栈的所有数字均不相等。例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈序列对应的一个弹出序列,但4,3,5,1,2就不可能是该压栈序列的弹出序列。(注意:这两个序列的长度是相等的)输入第...
2018-10-10 21:00:10 629
原创 HDU1022 Train Problem I(栈的应用)
As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over t...
2018-10-10 20:57:44 238
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人