leetcode
leetcode copied to clipboard
1168. optimize water distribution in a village python解法超出时间限制
虽然用Kruskal算法没有错,但实际在leetcode跑test case会超时。
待验证
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方法替换成上面的就好。
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.
can i fix this? @azl397985856
@rajat81 of course
hey, is this issue still open?
这是来自QQ邮箱的自动回复邮件。您好,邮件已收到,我将会尽快给您回复。
这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。
我已经收到了,会尽快查看的,谢谢
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?