摘要: 。。。 30次提交2次AC 这道题告诉我一个道理:交题要在评测机高兴的时候交(大雾) 其实是好好看题啦 话说输入0输出1 2333333333333333333333333333 邪道:直接map+并查集 路径压缩时把val[]所表示的高度改为子孙数即可 映射是好用 但1e6*10组数据*并查集的O 阅读全文
posted @ 2016-07-02 15:55 MukoiAoi 阅读(224) 评论(0) 推荐(0) 编辑
摘要: int setfind(int xx) { int fa=father[xx]; if(fa==xx) return fa; else return father[xx]=setfind(fa); } void setunion(int xx,int yy) { int X=setfind(xx); int Y=setfind(yy); if(X=... 阅读全文
posted @ 2016-07-02 15:55 MukoiAoi 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Portal: http://acm.hdu.edu.cn/showproblem.php?pid=1325 1272的原版? 依然并查集+map,ID分配正是好用 话说为什么hdu上rank和_是保留字? 与1272相比,由无向树变成了有向树,所以在1272的基础上维护结构时去掉左右合并rank优 阅读全文
posted @ 2016-07-02 13:48 MukoiAoi 阅读(110) 评论(0) 推荐(0) 编辑