2020年3月26日

并查集基础笔记

摘要: 并查集是通过找祖宗的方式,将分散的各个元素联系起来,形成一个个集合(组织)的一种数据结构或者说操作。 1.查找(寻找祖宗) 1 int Find(int x) 2 { 3 4 while(x!=father[x])//若祖宗值f[x]和自己x不同,说明另有其人 5 x=father[x];//直到找 阅读全文

posted @ 2020-03-26 19:24 轻描淡写ぃ 阅读(133) 评论(0) 推荐(0) 编辑

poj3617 Best Cow Line(贪心+字典序)

摘要: Best Cow Line Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 49343 Accepted: 12558 Description FJ is about to take his N (1 ≤ N ≤ 2,000) c 阅读全文

posted @ 2020-03-26 11:42 轻描淡写ぃ 阅读(114) 评论(0) 推荐(0) 编辑

导航