摘要: Problem Description Five hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficult for Monkey King(WuKong) ... 阅读全文
posted @ 2015-11-12 20:48 (慎独) 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 使用并查集查找时,如果查找次数很多,那么使用朴素版的查找方式肯定要超时。比如,有一百万个元素,每次都从第一百万个开始找,这样一次运算就是10^6,如果程序要求查找个一千万次,这样下来就是10^13,肯定要出问题的。 这是朴素查找的代码,适合数据量不大的情况: int findx(int x... 阅读全文
posted @ 2015-11-12 18:45 (慎独) 阅读(307) 评论(0) 推荐(0) 编辑