2013年5月23日

Uva 11374 - Airport Express 最短路

摘要: Problem D: Airport ExpressIn a small city called Iokh, a train service,Airport-Express, takes residents to the airport more quickly than other transports. There are two types of trains in Airport-Express, theEconomy-Xpressand theCommercial-Xpress. They travel at different speeds, take different rout 阅读全文

posted @ 2013-05-23 12:19 电子幼体 阅读(131) 评论(0) 推荐(0) 编辑

白书上的dijkstra+堆优化/dijkstra的一些性质

摘要: 模板#include #include #include #include #include #include using namespace std; const int maxn=11111; const int maxm=11111; const int INF=1e9; struct Edge{ int from,to,dist; }; struct HeapNode{ int d,u; bool operatorrhs.d; } }; struct Dijkstra{ int n,m; vector edges; ... 阅读全文

posted @ 2013-05-23 06:23 电子幼体 阅读(176) 评论(0) 推荐(0) 编辑

LA 3713 - Astronauts 2-SAT

摘要: The Bandulu Space Agency (BSA) has plans for the following three space missions:Mission A: Landing on Ganymede, the largest moon of Jupiter.Mission B: Landing on Callisto, the second largest moon of Jupiter.Mission C: Landing on Titan, the largest moon of Saturn.Your task is to assign a crew for eac 阅读全文

posted @ 2013-05-23 05:45 电子幼体 阅读(143) 评论(0) 推荐(0) 编辑

白书上的2-SAT模板

摘要: struct TWO_SAT{ int n; vectorG[maxn*2]; bool mark[maxn*2]; int S[maxn*2],c; bool dfs(int x){ if (mark[x^1]) return false; if (mark[x]) return true; mark[x]=true; S[c++]=x; for (int i=0;in=n; for (int i=0;i0) mark[S[--c]]=false; ... 阅读全文

posted @ 2013-05-23 03:18 电子幼体 阅读(161) 评论(0) 推荐(0) 编辑

导航