![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
并查集
Polynomial Hierarchy
路漫漫其修远兮,吾将上下而求索。
展开
-
并查集工具(菜鸟模板)
#includeint find[100001];int Find(int a){ return find[a]==a?a:find[a]=Find(find[a]);} int main(){ int i,x,n,m,a,b,c,d; while(scanf("%d%d%d",&n,&m,&x),(n!=0&&m!=0&&x!=0)) { for(i=0;i<n+10;原创 2014-02-18 16:53:27 · 543 阅读 · 0 评论 -
最小生成树(kruskal算法)
HighwaysTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 20119 Accepted: 9322DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately, F原创 2014-02-18 19:18:50 · 752 阅读 · 0 评论 -
并查集
F - Farm IrrigationTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1198DescriptionBenny has a spacious farm land to irrigate.原创 2014-02-27 13:34:09 · 606 阅读 · 0 评论 -
判树!
A - FriendshipTime Limit:3000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionA friend is like a flower,a rose to be exact,Or maybe like原创 2014-02-25 20:34:26 · 1012 阅读 · 0 评论 -
模型转化
F - Farm IrrigationTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionBenny has a spacious farm land to irrigate. The farm land is原创 2014-02-25 19:51:24 · 820 阅读 · 0 评论 -
查找元素
D - The SuspectsTime Limit:1000MS Memory Limit:20000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionSevere acute respiratory syndrome (SARS), an atypical pneumoni原创 2014-02-25 16:27:19 · 652 阅读 · 0 评论 -
找根的数量
E - Ubiquitous ReligionsTime Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionThere are so many different religions in the world tod原创 2014-02-25 16:25:28 · 518 阅读 · 0 评论 -
并查集
C - More is betterTime Limit:1000MS Memory Limit:102400KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionMr Wang wants some boys to help him with a project. Because t原创 2014-02-25 11:23:23 · 561 阅读 · 0 评论 -
并查集
A - 温习并查集1Time Limit:1000MS Memory Limit:20000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionSevere acute respiratory syndrome (SARS), an atypical pneumonia of unk原创 2014-07-24 09:56:36 · 515 阅读 · 0 评论