
搜索
文章平均质量分 70
ummmmm
这个作者很懒,什么都没留下…
展开
-
[BFS] 逃离迷宫 长沙理工大学校赛G
链接:https://www.nowcoder.com/acm/contest/96/G题目描述给你一个n*m的图,地图上'.'代表可以走的地方,而'#'代表陷阱不能走,'P'代表人物位置,'K'代表钥匙,'E'代表出口。人物一个,钥匙有多个,('K'的数量<=50)),出口一个,每个位置可以向(上,下,左,右)四个方向走一格,花费一个单位时间,现在你需要花费最少的时间拿到钥匙 然后从迷宫的...原创 2018-04-16 10:58:11 · 476 阅读 · 0 评论 -
[多源BFS] D. Fair 枚举颜色BFS CF987D
D. Fairtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputSome company is going to hold a fair in Byteland. There are nn towns in B...原创 2018-11-20 19:00:47 · 161 阅读 · 0 评论 -
[DFS] 树上删点使两连通块构成的点对最少 CFgym/101673F
#include <bits/stdc++.h>using namespace std;const int mn = 10010;int cnt;int to[2 * mn], nx[2 * mn], fr[mn];void add_edge(int u, int v){ to[cnt] = v; nx[cnt] = fr[u]; fr[u] =...原创 2018-11-01 20:08:01 · 295 阅读 · 0 评论 -
[DFS] 小矩阵限定颜色数量不相邻填色 HDU5113
Black And WhiteTime Limit: 2000/2000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 6000 Accepted Submission(s): 1644Special Judge Problem DescriptionIn...原创 2018-10-15 16:29:54 · 501 阅读 · 0 评论 -
【BFS预处理】单个数字变化或同种数字变化使两串相同 UVALive 7263
Today is a rainy day. The temperature is apparently lower than yesterday. Winter is coming. It always leaves people feeling fatigued and tired.Lee hasn’t prepared for winter yet. As he wakes up this...原创 2018-10-15 00:02:31 · 273 阅读 · 0 评论 -
[优化dfs] 小数据求固定大小的团数量 HDUCounting Cliques
A clique is a complete graph, in which there is an edge between every pair of the vertices. Given a graph with N vertices and M edges, your task is to count the number of cliques with a specific size ...原创 2018-10-11 18:19:39 · 128 阅读 · 0 评论 -
【BFS】天棋哥哥大战AlphaGo 校OJ2395
题目描述3月15日,人机围棋大战巅峰对决在韩国首尔落下帷幕。五番棋的最后一局中,韩国著名棋手李世乭尽管与人工智能“AlphaGo”缠斗至官子阶段,但在双双进入读秒后最终还是投子认输,以总比分1∶4结束了这场举世瞩目的人机大战。100年后的某一天,天棋哥哥为了给李世乭报仇,挽回人类尊严,代表人类向AlphaGo发起了挑战。100年后的AlphaGo比现在强了几百倍,谷歌公司允许天棋哥哥携带一个程序与...原创 2018-05-22 23:43:08 · 211 阅读 · 0 评论 -
【DFS】GirlCat HDU5706
D - GirlCat HDU - 5706 #include <bits/stdc++.h>using namespace std;int dir[4][2]={{0,-1},{-1,0},{0,1},{1,0}};char ch[1010][1010];int h,w;int gsum;int csum;void dfs(int i,int j,char c)...原创 2018-05-16 15:23:08 · 215 阅读 · 0 评论 -
【BFS】 扫雷 北京信息科技大学校赛F
链接:https://www.nowcoder.com/acm/contest/118/F来源:牛客网 《扫雷》是一款大众类的益智小游戏,于1992年发行。游戏目标是在最短的时间内根据点击格子出现的数字找出所有非雷格子,同时避免踩雷,踩到一个雷即全盘皆输。当某个位置为数字的时,代表它周围的八连通区域中有对应数量的雷。 kirai获取了简化版扫雷(没有标记雷的小旗)的后台数据(后台数据包括所有数...原创 2018-05-06 00:03:47 · 393 阅读 · 1 评论 -
【DFS】周末出游 校OJ2348
题目描述周末天气真好,大家组织一起出去玩(玩你妹,不好好学习),可是,有些人要知道(有好朋友了不起呀)自己最要好的朋友接受邀请了,他才会去,只有邀请到他们最好的朋友才会去(贱人就是矫情)。可是作为负责人的你(冤大头)必须判断是否能够办好这次聚会(气死爸爸拉,哼),邀请到所有的人。输入输入包含多组测试数据,每组测试数据第一行输入n(0<n<1000),表示有n个人。然后第二行输入n个数,...原创 2018-05-17 16:09:19 · 163 阅读 · 0 评论 -
[DFS] 数的全排列
输入n,字典序输出1~n的全排列。123132213231312321#include <bits/stdc++.h>using namespace std;int n;int a[10];bool vis[10];void dfs(int w){ if(w==n) //第n位 即之前已赋值 { for(int i=0; i<n; ...原创 2018-04-19 20:23:54 · 359 阅读 · 0 评论 -
[DFS+DP] Machine 浙大月赛H 14.08
In a typical assembly line, machines are connected one by one. The first machine's output product will be the second machine's raw material. To simplify the problem, we put all machines into a two-dim...原创 2018-04-18 19:14:39 · 160 阅读 · 0 评论 -
[DFS] red and black POJ1979
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 adjacent tiles. ...原创 2018-04-11 19:42:25 · 148 阅读 · 0 评论 -
[BFS] 求一定数位和的D的最小倍数 CFcontest1070A
余数500 * 数位和5000 = 25w种情况BFS先达到该种状态的一定数值最小#include <bits/stdc++.h>using namespace std;struct node{ int num, yu, sum;};queue<node> que;node fr[520][5020];bool vis[520][5020];...原创 2018-12-10 18:27:48 · 239 阅读 · 0 评论