結果
問題 |
No.1639 最小通信路
|
ユーザー |
![]() |
提出日時 | 2021-08-18 22:09:52 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 296 bytes |
コンパイル時間 | 228 ms |
コンパイル使用メモリ | 82,232 KB |
実行使用メモリ | 76,916 KB |
最終ジャッジ日時 | 2024-10-11 22:05:59 |
合計ジャッジ時間 | 4,696 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 37 WA * 6 |
ソースコード
N = int(input()) ABC = [list(map(int,input().split())) for _ in range(N*(N-1)//2)] ABC.sort(key = lambda x:x[2]) ctd = set() ans = 0 for abc in ABC: a,b,c = abc if a in ctd and b in ctd: continue else: ans = max(ans,c) ctd.add(a) ctd.add(b) print(ans)