HDU2485 Destroying the bus stations (POJ3921)
摘要:
1 /* 2 題意:軍隊坐bus去機場 n個節點(bus)m條公交通路(單向) 3 每走一條路花時間1 問最少破壞幾個結點(是相關聯的的路都不能走) 4 使軍隊在至少k時間不能到達機場。 5 思路:求最小割(等于最大流) 6 建(新)圖:弗洛伊德求出任意兩點最短路(dist[a][b]) 7 核心判斷dist(1,a)+dist(b,n)之和滿足小于k 則建邊addedge(n+a,b,INF) 8 9 addedge(i,i+n,1);//注意方向 10 11 start=n+1,end=n;totals=n+n; 12 sap();即可。 13 */ 14 #inc... 閱讀全文
posted @ 2013-04-23 19:46 ACM_Someone like you 閱讀(345) 評論(0) 推薦(0)
浙公網安備 33010602011771號