摘要:
带权并查集,d[x]维护x到父节点的距离 #include<bits/stdc++.h> using namespace std; const int N = 1e5+10; int fa[N],d[N]; int find(int x){ if(x!=fa[x]){ int t=find(fa[x 阅读全文
posted @ 2022-05-17 20:29
xhy666
阅读(35)
评论(0)
推荐(0)
摘要:
对于第i(1<=i<=n)列为最终状态,分为3种情况 f[0][i]表示这列的没有'*' f[1][i]表示这列有且仅有第一行有'*' f[2][i]表示这列有且仅有第二行有'*' #include<bits/stdc++.h> using namespace std; const int N = 阅读全文
posted @ 2022-05-17 16:23
xhy666
阅读(29)
评论(0)
推荐(0)

浙公网安备 33010602011771号