結果

問題 No.1639 最小通信路
ユーザー ytftytft
提出日時 2022-03-22 18:18:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 72,792 KB
最終ジャッジ日時 2024-04-18 17:13:35
合計ジャッジ時間 3,805 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,408 KB
testcase_01 AC 36 ms
53,040 KB
testcase_02 AC 52 ms
67,044 KB
testcase_03 AC 58 ms
72,792 KB
testcase_04 AC 60 ms
72,432 KB
testcase_05 AC 47 ms
64,628 KB
testcase_06 AC 46 ms
64,688 KB
testcase_07 AC 35 ms
52,532 KB
testcase_08 AC 54 ms
67,468 KB
testcase_09 AC 36 ms
53,624 KB
testcase_10 AC 36 ms
60,520 KB
testcase_11 AC 48 ms
65,100 KB
testcase_12 AC 44 ms
60,896 KB
testcase_13 AC 51 ms
66,068 KB
testcase_14 AC 36 ms
53,132 KB
testcase_15 AC 42 ms
60,344 KB
testcase_16 AC 43 ms
66,292 KB
testcase_17 AC 45 ms
66,296 KB
testcase_18 AC 37 ms
54,676 KB
testcase_19 AC 43 ms
64,820 KB
testcase_20 AC 45 ms
66,480 KB
testcase_21 AC 34 ms
52,340 KB
testcase_22 AC 40 ms
61,208 KB
testcase_23 AC 46 ms
64,108 KB
testcase_24 AC 40 ms
60,620 KB
testcase_25 AC 39 ms
60,948 KB
testcase_26 AC 36 ms
53,776 KB
testcase_27 AC 35 ms
53,464 KB
testcase_28 AC 35 ms
52,064 KB
testcase_29 AC 46 ms
65,740 KB
testcase_30 AC 50 ms
68,348 KB
testcase_31 AC 38 ms
55,388 KB
testcase_32 AC 48 ms
67,544 KB
testcase_33 AC 36 ms
54,300 KB
testcase_34 AC 46 ms
66,424 KB
testcase_35 AC 57 ms
71,100 KB
testcase_36 AC 47 ms
65,304 KB
testcase_37 AC 48 ms
66,660 KB
testcase_38 AC 32 ms
53,064 KB
testcase_39 AC 39 ms
59,028 KB
testcase_40 AC 33 ms
53,356 KB
testcase_41 AC 34 ms
54,092 KB
testcase_42 AC 52 ms
67,304 KB
testcase_43 AC 34 ms
53,948 KB
testcase_44 AC 34 ms
53,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda:sys.stdin.readline().rstrip()
def find(par,i):
    if par[i]==-1:
        return i
    root=find(par,par[i])
    par[i]=root
    return root
def unite(par,i,j):
    par[find(par,i)]=find(par,j)
N=int(input())
par=[-1 for i in range(N)]
ans=0
for i in range(N*(N-1)//2):
    a,b,C=map(int,input().split())
    if find(par,a-1)!=find(par,b-1):
        unite(par,a-1,b-1)
        ans=max(ans,C)
print(ans)
0