1 2 3 4
摘要: https://ac.nowcoder.com/acm/contest/7079/C 由题可知是最小生成树,先把比L【i】小的连通块建立好,合并集合x,y可得 》 par[y] = x,ans += siz[x]*siz[y],siz[x] += siz[y]; #include<iostream> 阅读全文
posted @ 2020-09-03 22:24 Lesning 阅读(230) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.com/contest/1400/problem/D i<j<k<l 假设x = list【j】 y = list【k】 可以枚举j和k,0 j-1有a个y,k+1 -- n有b个x,ans+=a*b枚举就好了 具体看代码 #include<iostream> 阅读全文
posted @ 2020-09-03 21:25 Lesning 阅读(204) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.com/contest/1400/problem/B 有一点很重要,s能用完就一定会用完,枚举我用几个s就好 #include<iostream> #include<cstring> #include<queue> #include<algorithm> usi 阅读全文
posted @ 2020-09-03 15:17 Lesning 阅读(205) 评论(0) 推荐(0) 编辑