贪心+并查集

HDU 1598

//想了好几天,刚开始时想用DFS,然后TLE了,接着想用下DP,发现不可行,然后,然后就看了题解了;

#include 
#include
#include
using namespace std;
const int MAX=99999999;
struct node
{
    int start;
    int wei;
    int val;


};
int pre[202];
int cmp(node a,node b)
{

    return a.val


你可能感兴趣的:(被虐——并查集)