摘要: 比食物链那道题还要简单,简单的带权并查集应用,不过要注意只有两个人的特殊情况。 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> using namespace std; const char 阅读全文
posted @ 2020-07-15 22:48 IdiotNe 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 重新做了一下这道并查集的题目,关键要点是抓住这种循环的关系和模运算的通性,进而利用加权并查集 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> using namespace std; cons 阅读全文
posted @ 2020-07-15 20:17 IdiotNe 阅读(108) 评论(0) 推荐(0) 编辑