您当前的位置: 首页 > 

钟钟终

暂无认证

  • 1浏览

    0关注

    233博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

2/21 并查集+dfs

钟钟终 发布时间:2022-02-21 23:37:09 ,浏览量:1

https://www.luogu.com.cn/problem/P2212

并查集建边,点边转换
#include 
#define int long long
using namespace std;
const int maxn=1e7+5;
struct node
{
    int x,y,dis;
}e[maxn];
struct Edge
{
    int u,v,dis;
}edge[maxn];
int n,c,f[maxn],cnt,ans,g;
void add(int from,int to,int dis)
{
    edge[++cnt].u=from;
    edge[cnt].v=to;
    edge[cnt].dis=dis;
}
bool cmp(Edge e1,Edge e2)
{
    return e1.dis            
关注
打赏
1664378814
查看更多评论
0.0410s