摘要: int find(int x){ int temp=x; while(temp!=d[temp]) temp=d[temp]; while(x!=d[x]){ x=d[x]; d[x]=temp; } return temp; } 阅读全文
posted @ 2020-03-19 19:39 WeiAR 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 二分答案出最小距离,dpcheck,单调队列优化dp #include <iostream> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <cstring> #define inf 阅读全文
posted @ 2020-03-19 19:34 WeiAR 阅读(163) 评论(0) 推荐(0) 编辑