05 2016 档案
摘要:给你力量L,求有多少条path的力量小于等于L。这个path消耗的力量是T,T是U到V上最长的边。所以说,只要求得有多少个点对使得点对之间的最大的边小于L即可。采用并查集,离线计算,询问从小到大排序,然后边从小到大排序,然后一个一个加入并查集中,加一条,计算一次两个集合的点的数目的...
阅读全文
摘要:roblem Description 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #define inf (1>1)using namespace std;#define MAXN 505bool map[MAXN...
阅读全文
摘要:#include#include#include#include#include#include#includeusing namespace std;const int N=100010;int isin[N],dfn[N],low[N],bel[N];vectorg[N];in...
阅读全文
摘要:点击打开链接#include#include#include#include#include#include#includeusing namespace std;#define V 10010#define E 100010#define inf 0x3f3f3f3fstruct Edge{ ...
阅读全文
摘要:#include#include#include#include#include#includeusing namespace std;const int maxn=2010;struct { int x,y,w,next;}e[maxnq; vis[src]=1; dis[s...
阅读全文