随笔分类 -  最短路的问题

摘要:首先这个题化成两个集合还是很容易的想到的,但是不知道怎么用二进制表示,感觉这个题的脑洞还是很大的。 为什么可以用二进制表示化成集合可以包含所有的点对,因为要是两个数不同的话肯定会有一个二进制的位数不同 所以就包含了所有的点对。 阅读全文
posted @ 2017-08-26 10:46 Heilce 阅读(394) 评论(0) 推荐(0)
摘要:#include using namespace std; const int N=2e6; int node[N],nxt[N],head[N],data[N]; int n,m,d[N],tot,begins; int abs(int x) { if(x > heap; heap.push(make_pair(-d[begins],begins)); while (1... 阅读全文
posted @ 2017-07-18 16:15 Heilce 阅读(158) 评论(0) 推荐(0)
摘要:#include #include #include using namespace std; const int N=405; struct rec { int v,w; }; vector edge[N*N]; int n,st,ed; __int64 dis[N*N]; bool vis[N*N]; struct cmp { bool operator()(int a... 阅读全文
posted @ 2017-04-08 16:27 Heilce 阅读(262) 评论(0) 推荐(0)