leetcode icon indicating copy to clipboard operation
leetcode copied to clipboard

1168. optimize water distribution in a village python解法超出时间限制

Open xuxingya opened this issue 5 years ago • 10 comments

虽然用Kruskal算法没有错,但实际在leetcode跑test case会超时。

xuxingya avatar Oct 30 '19 14:10 xuxingya

待验证

azl397985856 avatar Oct 30 '19 23:10 azl397985856

        def find(x):
            tmp = []
            while x!=union_find[x]:
                tmp.append(x)
                x = union_find[x]
            for i in tmp:
                union_find[i] = x
            return x

把find方法替换成上面的就好。

xuxingya avatar Oct 31 '19 14:10 xuxingya

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 31 '19 01:12 stale[bot]

can i fix this? @azl397985856

rajat81 avatar Sep 16 '22 19:09 rajat81

@rajat81 of course

azl397985856 avatar Sep 17 '22 02:09 azl397985856

hey, is this issue still open?

imguptaharsh avatar Oct 26 '23 06:10 imguptaharsh

这是来自QQ邮箱的自动回复邮件。您好,邮件已收到,我将会尽快给您回复。

cherie-wuyajun avatar Oct 26 '23 06:10 cherie-wuyajun

这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。

fyyzkd avatar Oct 26 '23 06:10 fyyzkd

我已经收到了,会尽快查看的,谢谢

xiaosisong avatar Oct 26 '23 06:10 xiaosisong

hey, is this issue still open?

yes. Why I didn't close it is that I can't verify it now. because it's a member-only problem now. So anyone help me to verify?

azl397985856 avatar Oct 30 '23 06:10 azl397985856