摘要: 由题解题意可知,就是求第二类斯特灵数 dp会吧……高精会吧…… #include<bits/stdc++.h> using namespace std; string add(string a,string b){ string ans; int na[1005]={0},nb[1005]={0}; 阅读全文
posted @ 2025-03-04 20:52 yzc_is_SadBee 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 最大生成树+lca。 参考资料 思路 首先便是想到了Floyd的暴力方法,状态转移方程也不难推出:w[i][j]=max(w[i][j], min(w[i][k],w[k][j]));但是n3次方时间复杂度和n2的空间复杂度是显然不可取的。 于是我们思考,可以发现有一些权值较小的边是不会被走过的。正 阅读全文
posted @ 2025-03-04 19:39 yzc_is_SadBee 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 早过了,但O2会爆 于是进行面向题解的编码 裸kruskal #include<bits/stdc++.h> using namespace std; struct node { int x,y,s; } d[200000]; int n,m,ans,num,f[1000],w,k,c; bool 阅读全文
posted @ 2025-03-04 18:50 yzc_is_SadBee 阅读(1) 评论(0) 推荐(0) 编辑