結果

問題 No.1639 最小通信路
ユーザー DrDrpilotDrDrpilot
提出日時 2022-01-28 12:36:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 699 bytes
コンパイル時間 756 ms
コンパイル使用メモリ 10,888 KB
実行使用メモリ 9,796 KB
最終ジャッジ日時 2023-08-28 09:00:13
合計ジャッジ時間 4,598 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,504 KB
testcase_01 AC 18 ms
8,516 KB
testcase_02 AC 75 ms
9,400 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 31 ms
8,840 KB
testcase_06 AC 40 ms
8,964 KB
testcase_07 AC 19 ms
8,452 KB
testcase_08 AC 58 ms
9,384 KB
testcase_09 AC 21 ms
8,552 KB
testcase_10 AC 25 ms
8,628 KB
testcase_11 AC 47 ms
9,040 KB
testcase_12 AC 28 ms
8,752 KB
testcase_13 AC 73 ms
9,544 KB
testcase_14 AC 19 ms
8,500 KB
testcase_15 AC 27 ms
8,708 KB
testcase_16 AC 49 ms
8,976 KB
testcase_17 AC 58 ms
9,356 KB
testcase_18 AC 20 ms
8,536 KB
testcase_19 AC 34 ms
8,720 KB
testcase_20 AC 61 ms
9,224 KB
testcase_21 AC 18 ms
8,632 KB
testcase_22 AC 30 ms
8,764 KB
testcase_23 AC 40 ms
8,820 KB
testcase_24 AC 28 ms
8,616 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n=int(input())
g=[[] for _ in range(n)]
for _ in range(n*(n-1)//2):
    a,b,c=map(int,input().split())
    a-=1;b-=1
    g[a].append((b,c))
    g[b].append((a,c))
def f(d):
    visit=[False]*n
    q=deque()
    q.append(0)
    while q:
        now=q.popleft()
        if visit[now]:
            continue
        visit[now]=True
        for to,cost in g[now]:
            if cost>d:
                continue
            if visit[to]:
                continue
            q.append(to)
    for i in visit:
        if i==False:
            return False
    return True
r=10**20
l=0
while r-l>1:
    mid=(l+r)//2
    if f(mid):
        r=mid
    else:
        l=mid
print(r)
0