随笔分类 - BFS
摘要:problemsolutioncodes//BFS+记忆化搜索#include#include#include#define maxn 100000using namespace std;int f[maxn],ans;int a, b;void bfs(){ ...
阅读全文
摘要:problemsolutioncodes#include#includeusing namespace std;struct xyz{ int x, y; xyz(int x = 0, int y = 0):x(x),y(y){};};int m, n, ...
阅读全文
摘要:problemsolutioncodes#include#includeusing namespace std;struct xyz{ int x, y; xyz(int x = 0, int y = 0):x(x),y(y){};};int n, m, ...
阅读全文
摘要:problemsolutioncodes#include#includeusing namespace std;int n, m, a[1010][1010], book[1010][1010], x, y, ans;const int dx[] = {0,0,-1,...
阅读全文
摘要:problemsolutioncodes#include#include#include//set判重防MLEusing namespace std;const int dx[4] = {-1, 0, 1, 0};const int dy[4] = {0, 1, 0,...
阅读全文
摘要:problemsolutioncodes//思路:把空白当棋,交替黑白走。//实现:BFS, 打表判断是否成立#include#include#include#includeusing namespace std;string s;struct node{ st...
阅读全文
摘要:problemsolutioncodes#include#include#include#include#includeusing namespace std;const int dx[] = {0,0,-1,1};const int dy[] = {1,-1,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...
阅读全文
摘要:problemsolutioncodes//思路就是对于每个状态下的字符串,枚举可以替换的部分替换作为下一个新的状态。#include#include#include#includeusing namespace std;int n = 1, flag;string ...
阅读全文