2013年4月29日

HDU 1598--并查集+贪心

摘要: 题意:中文题,不解释。思路:按照Flycar的速度(即边权)排序,通过并查集依次将边添加进去,枚举各种情况。AC代码:View Code 1 #include<iostream> 2 #include<algorithm> 3 using namespace std; 4 struct node { 5 int s,t,v; 6 bool operator < (const node &cmp) const{ 7 return v<cmp.v; 8 } 9 }edge[1010];10 int p[222];11 int findx(int x)12 阅读全文

posted @ 2013-04-29 20:46 acoderworld 阅读(79) 评论(0) 推荐(0)

导航