結果
問題 |
No.3087 University Coloring
|
ユーザー |
|
提出日時 | 2025-04-05 07:52:00 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 309 bytes |
コンパイル時間 | 526 ms |
コンパイル使用メモリ | 82,220 KB |
実行使用メモリ | 67,452 KB |
最終ジャッジ日時 | 2025-04-05 07:52:08 |
合計ジャッジ時間 | 5,883 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 33 |
ソースコード
from atcoder.dsu import DSU n,m=map(int,input().split()) que=[] for _ in range(m): a,b,c=map(int,input().split()) a-=1 b-=1 que.append((c,a,b)) que.sort(reverse=True) uf=DSU(n) ans=0 for i in range(m): d,a,b=que[i] if not uf.same(a,b): uf.merge(a,b) ans+=d print(ans*2)