diff --git a/RQNOJ/600.cpp b/RQNOJ/600.cpp new file mode 100644 index 0000000..06c4289 --- /dev/null +++ b/RQNOJ/600.cpp @@ -0,0 +1,59 @@ +#include +#include +#include +#include +using namespace std; + +#define MAXM 100000 +#define MAXN 20000 +struct ppk +{ +    int a,b,c; +}; +bool cmp(const ppk& a,const ppk& b) +{ +    return a.c>b.c; +} +int f[MAXN*2]; +ppk X[MAXM]; + +int get(int x) +{ +    if(x==f[x]) return x; +    else +    { +        f[x]=get(f[x]); +        return f[x]; +    } +} + +int main() +{ +    int n,m; +    scanf("%d %d",&n,&m); +    for(int i=1;i<=n*2;i++) +    { +        f[i]=i; +    } +    for(int i=0;i