From 598478c7e28383d92bf7675c7a38e3f5d58eb100 Mon Sep 17 00:00:00 2001 From: plum-king Date: Sat, 27 May 2023 11:01:58 +0900 Subject: [PATCH] =?UTF-8?q?#31=20:=20=ED=94=84=EB=A1=9C=EA=B7=B8=EB=9E=98?= =?UTF-8?q?=EB=A8=B8=EC=8A=A4=5F=EC=84=AC=20=EC=97=B0=EA=B2=B0=ED=95=98?= =?UTF-8?q?=EA=B8=B0.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...60\352\262\260\355\225\230\352\270\260.py" | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 "\354\235\264\353\213\210\354\247\200\354\210\230/\354\204\254 \354\227\260\352\262\260\355\225\230\352\270\260.py" diff --git "a/\354\235\264\353\213\210\354\247\200\354\210\230/\354\204\254 \354\227\260\352\262\260\355\225\230\352\270\260.py" "b/\354\235\264\353\213\210\354\247\200\354\210\230/\354\204\254 \354\227\260\352\262\260\355\225\230\352\270\260.py" new file mode 100644 index 0000000..b57a025 --- /dev/null +++ "b/\354\235\264\353\213\210\354\247\200\354\210\230/\354\204\254 \354\227\260\352\262\260\355\225\230\352\270\260.py" @@ -0,0 +1,26 @@ +parent=[] + +def find(parent,x): + if(parent[x]==x): + return x + return find(parent,parent[x]) + +def union(parent,a,b): + rootA=find(parent,a) + rootB=find(parent,b) + if(rootA