From 845565c0b091e543c0a259e1f61ef6d965b897e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Sat, 30 Jul 2022 12:14:37 +0800 Subject: [PATCH] fix: same judge --- main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index ad5564a..c9ea816 100644 --- a/main.go +++ b/main.go @@ -163,7 +163,14 @@ func main() { INNERLOP: for l, set := range sameset { for _, item := range set { - if item == uint(i) && l != k { // 找到旧组 + if item == uint(i) { // 找到旧组 + if l == k { + if isdebu { + fmt.Println("set", i, "and", x, "already in the same set") + } + hasfound = true + break INNERLOP + } if isdebu { fmt.Println("merge old set", set, "into", sameset[k]) }