随笔分类 -  BFS

摘要:problemsolutioncodes//BFS+记忆化搜索#include#include#include#define maxn 100000using namespace std;int f[maxn],ans;int a, b;void bfs(){ ... 阅读全文
posted @ 2018-06-06 21:08 gwj1139177410 阅读(119) 评论(0) 推荐(0)
摘要:problemsolutioncodes#include#includeusing namespace std;struct xyz{ int x, y; xyz(int x = 0, int y = 0):x(x),y(y){};};int m, n, ... 阅读全文
posted @ 2018-06-04 21:58 gwj1139177410 阅读(119) 评论(0) 推荐(0)
摘要:problemsolutioncodes#include#includeusing namespace std;struct xyz{ int x, y; xyz(int x = 0, int y = 0):x(x),y(y){};};int n, m, ... 阅读全文
posted @ 2018-06-03 10:33 gwj1139177410 阅读(108) 评论(0) 推荐(0)
摘要:problemsolutioncodes#include#includeusing namespace std;int n, m, a[1010][1010], book[1010][1010], x, y, ans;const int dx[] = {0,0,-1,... 阅读全文
posted @ 2018-06-03 10:32 gwj1139177410 阅读(102) 评论(0) 推荐(0)
摘要:problemsolutioncodes#include#include#include//set判重防MLEusing namespace std;const int dx[4] = {-1, 0, 1, 0};const int dy[4] = {0, 1, 0,... 阅读全文
posted @ 2018-05-30 21:36 gwj1139177410 阅读(143) 评论(0) 推荐(0)
摘要:problemsolutioncodes//思路:把空白当棋,交替黑白走。//实现:BFS, 打表判断是否成立#include#include#include#includeusing namespace std;string s;struct node{ st... 阅读全文
posted @ 2018-05-29 21:38 gwj1139177410 阅读(120) 评论(0) 推荐(0)
摘要:problemsolutioncodes#include#include#include#include#includeusing namespace std;const int dx[] = {0,0,-1,1};const int dy[] = {1,-1,0,0... 阅读全文
posted @ 2018-05-27 21:23 gwj1139177410 阅读(129) 评论(0) 推荐(0)
摘要:problemsolutioncodes#include#include#includeusing namespace std;int n, m, o, a[40][40][40], vis[40][40][40];int sx, sy, sz, ex, ey, ez... 阅读全文
posted @ 2018-05-26 13:20 gwj1139177410 阅读(154) 评论(0) 推荐(0)
摘要:problemsolutioncodes//思路就是对于每个状态下的字符串,枚举可以替换的部分替换作为下一个新的状态。#include#include#include#includeusing namespace std;int n = 1, flag;string ... 阅读全文
posted @ 2018-05-24 13:33 gwj1139177410 阅读(131) 评论(0) 推荐(0)

选择