您当前的位置: 首页 > 

*DDL_GzmBlog

暂无认证

  • 1浏览

    0关注

    605博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

*水题 [Luogu] P3420 [POI2005]SKA-Piggy Banks

*DDL_GzmBlog 发布时间:2021-06-20 20:39:18 ,浏览量:1

前言

因为 一不小心把init 写在了 cin>>n前面 导致debug半天 所以下次不分开写了 呜呜呜

CODE
#include 
#define IOS  ios::sync_with_stdio(false)
using namespace std;
typedef long long ll;
const int N = 1e6+10;
int p[N],n,m,st[N];
int find(int x)
{
    if(x!=p[x])
        return p[x] =find(p[x]);
    return p[x];
}
void init()
{
    for(int i=1; i>n;
    init();
    int ans =0;

    for(int  i=1; i>x;
        int fi = find(i);
        int fx = find(x);
        p[fi] =fx;
    }

    for(int i=1; i            
关注
打赏
1657615554
查看更多评论
0.0598s