摘要: #include #include #include //#include #include //#include using namespace std; int n,m; #define maxn 200011 int root[maxn]; bool die[maxn]; int find(int x) {return root[x]==x?x:(root[x]=find(root[x]... 阅读全文
posted @ 2018-01-10 18:42 Blue233333 阅读(159) 评论(0) 推荐(0) 编辑
摘要: n<=10000000的图,满足:如果(i,j)>1就连一条边权1的无相变,问所有d(u,v) (u<=v)--u到v的最短路之和。 首先1和>n/2的质数都是孤立的点。然后两个数x,y如果(x,y)>1最短路就1,如果(x,y)=1且x,y都不是1或>n/2的质数一定能走,具体这么走:$P_x$- 阅读全文
posted @ 2018-01-10 10:56 Blue233333 阅读(294) 评论(0) 推荐(0) 编辑