摘要: 解法一 第一步:确定状态——原问题?子问题? \(f[i]\) 前$i$个数的最长不下降子序列——求不了啊~为什么求不了? 不知道这个序列的最后一个元素是哪个,没法转移 $f[i]$以第$i$个数为结尾的最长不下降子序列 第二步:确定状态转移方程 \(f[i]=max\{f[j]+1\}(a[j]< 阅读全文
posted @ 2020-09-28 23:39 Dazzling! 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 三维$bfs$模板 const int N=110; struct Node { int x,y,z; }; char g[N][N][N]; int dist[N][N][N]; int n; inline bool check(int x,int y,int z) { return x>=0 & 阅读全文
posted @ 2020-09-28 23:27 Dazzling! 阅读(93) 评论(0) 推荐(0) 编辑
摘要: $bfs$裸题,加两个$bool$变量判断下一步是否能继续走就好了 const int N=1010; char g[N][N]; int dist[N][N]; struct Node { int x,y; bool F,M; }; PII ed; int n,m; inline bool che 阅读全文
posted @ 2020-09-28 18:21 Dazzling! 阅读(156) 评论(0) 推荐(0) 编辑