
简单搜索
DlPF_C
这个作者很懒,什么都没留下…
展开
-
棋盘问题
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。输入输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n 当为-1 -1时表示输入结束。随后的转载 2017-05-12 16:01:45 · 336 阅读 · 0 评论 -
2018 华中科技大学校赛 L Fresh Air 思维BFS
链接:https://www.nowcoder.com/acm/contest/106/L来源:牛客网It’s universally acknowledged that there’re innumerable trees in the campus of HUST.And you know that, trees have the special ability to refresh the ...原创 2018-04-30 11:34:33 · 508 阅读 · 0 评论 -
POJ 1190生日蛋糕
生日蛋糕Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 21221 Accepted: 7546Description7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1 R原创 2018-01-29 17:42:51 · 354 阅读 · 0 评论 -
Uva -11624 Fire!
原题链接:https://vjudge.net/problem/UVA-11624双入口同时BFS#include#define INF 10001010using namespace std;char M[1010][1010];int T[1010][1010];bool judgej[1010][1010];bool judgef[1010][1010];int n原创 2018-01-30 17:37:16 · 277 阅读 · 0 评论 -
Uva10047 The Monocycle
原题链接:https://vjudge.net/problem/UVA-10047绞尽脑汁的图论题,虽然只是bfs但是要求到达的最小时间以及符合到达终点的条件还是需要思考一番。用优先队列保证到达时间最小,每一个方块的访问方式由进入的方向以及轮子的颜色划分。#include#define INF 0x3f3f3f3fusing namespace std;int n,m;int原创 2018-01-30 17:32:52 · 343 阅读 · 0 评论 -
UVA - 10285 Longest Run on a Snowboard
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1226DFS+记忆化搜索#include#define N 105#define INF 200int maps[N][N];int ans[N][N];int dfs(int原创 2017-08-25 14:27:39 · 365 阅读 · 0 评论 -
CodeForces - 793B Igor and his way to work dfs搜索
B. Igor and his way to worktime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWoken up by the alarm clock Igo原创 2017-08-25 11:31:05 · 373 阅读 · 0 评论 -
DFS和BFS的思路模板伪代码
随着学习的不断深入和对DFS,BFS的使用熟练,对这两种算法的思路有了更清晰的认识,现在使用这个模板感觉更灵活一些。DFSvoid dfs(状态A){ if(A不合法) return; if(A为目标状态) 输出或记录路径 if(A不为目标状态) dfs(A+Δ ) } BFSq.push(head);while(!q.empty()){ temp=q原创 2017-08-04 21:03:13 · 7486 阅读 · 0 评论 -
FZU—2150 Fire Game
Problem 2150 Fire GameAccept: 2404 Submit: 8336 Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionFat brother and Maze are playing a kind of special (hentai) game原创 2017-07-16 17:11:21 · 325 阅读 · 0 评论 -
POJ—3984 迷宫问题
迷宫问题Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 22710 Accepted: 13239Description定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0,原创 2017-07-16 16:25:10 · 279 阅读 · 0 评论 -
POJ2251 - Dungeon Master
Dungeon MasterTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 34963 Accepted: 13358DescriptionYou are trapped in a 3D dungeon and need to find the qui原创 2017-07-13 10:27:56 · 308 阅读 · 0 评论 -
牛客多校第七场 C Bit Compression
链接:https://www.nowcoder.com/acm/contest/145/C来源:牛客网 题目描述A binary string s of length N = 2n is given. You will perform the following operation n times :- Choose one of the operators AND (&),...原创 2018-08-11 09:24:54 · 286 阅读 · 0 评论