搜索题目
星落之地
网络并不改变人性,它只是提供某些前所未有的可能性,把人性中潜伏的某种因素给激发出来。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU1495非常可乐
题目的思路还是很简单的:因为要求最优解,广度优先搜索,对倒酒的六种操作进行遍历就行了。然而:在这个题上作者至少卡了小半天。下面就是作者找到的一些WA点。1.在记录是否被遍历过的状态时,用vis[N][N],来记录是否被遍历过。因为确定了其中两个瓶子,第三个瓶子的状态自然就知道了。关键时,记录的时候,要用后两个瓶子的装酒状态,因为,如果用前两个瓶子的装酒状态的话。s里的酒比a和b瓶子里的酒都要多,若N原创 2017-07-12 16:10:34 · 282 阅读 · 0 评论 -
POJ 3087 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 chip...原创 2018-05-27 12:01:54 · 155 阅读 · 0 评论 -
poj迷宫问题
迷宫问题题意:定义一个二维数组: int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 × 5的二维数组,表示一个迷宫。数据保证有原创 2017-07-11 11:29:57 · 266 阅读 · 0 评论 -
BFS入门(伪模板)
bfs广度优先搜索最近做了一些搜索题,突然,发现,原来是有套路这种东西存在的。总结了一些比较基础的bfs代码。该代码是poj3278农夫追牛问题的AC代码:代码如下:主要看注释#include <iostream>#include<queue>#include<cstring>#include<algorithm>#include<cstdio>using namespace std;#原创 2017-07-11 20:42:37 · 664 阅读 · 0 评论 -
hdu2102A计划
题目看链接:https://vjudge.net/problem/HDU-2102大致思路:本来是一个很基础的走迷宫找最短路径的问题,因为加了一个比较特殊的传送门之后,让这道题的判断条件出了一点变化。正常的迷宫无非就三种状态,能走,是石头,走过了。然而这里加了第四种状态——传送门。就将判断条件变复杂了。 首先: 1.初步筛选,看它是不是在迷宫的范围之内以及有没有走过。 2.进行大致筛选:三个分原创 2017-07-18 21:05:06 · 237 阅读 · 0 评论 -
HDU2181 哈密顿世界环游
先附上代码#include #include #define MAX 21#define bool int#define false 0#define true 1bool map[MAX][MAX];//实心体地图//第一个数记录当前节点//第二个树记录下一个能走的节点bool used[MAX];//标记城市走过int res[MAX];//保存当前走过的路径i原创 2017-07-18 14:26:06 · 703 阅读 · 0 评论 -
农夫追牛问题,广搜
农夫追牛问题问题描述: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 ≤原创 2017-07-09 10:52:33 · 1227 阅读 · 0 评论 -
棋盘问题
问题描述解决思路深度优先搜索,用一个数组vis记录已经放好棋子的状态,当放好之后再,撤销。 详细代码如下;#include<stdio.h>#include<string.h>int n,k,vis[15],ans;//全局变量k,n//k需要摆放的棋子的总个数//全局变量ans,解决方案个数char mat[15][15];//储存矩阵使用void dfs(int cur,int原创 2017-07-08 10:12:03 · 289 阅读 · 0 评论 -
UVA572oil deposits
题目:The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides原创 2017-07-15 12:11:01 · 258 阅读 · 0 评论 -
POJ 3126 primepath
题目:Prime PathThe 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原创 2017-07-14 17:58:18 · 412 阅读 · 0 评论 -
POJ.Find The Multiple
题目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 ther原创 2017-07-13 15:18:47 · 253 阅读 · 0 评论 -
HDU2612 find a way
题意:Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki. Yifenfei’s home is at the原创 2017-07-13 11:55:08 · 217 阅读 · 0 评论 -
POJ 1753
Flip GameTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on ea...转载 2018-08-16 22:01:08 · 723 阅读 · 0 评论
分享