結果
問題 | No.3057 Tree Distance Set |
ユーザー |
![]() |
提出日時 | 2025-03-01 13:32:16 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 45 ms / 2,000 ms |
コード長 | 320 bytes |
コンパイル時間 | 300 ms |
コンパイル使用メモリ | 82,712 KB |
実行使用メモリ | 60,232 KB |
最終ジャッジ日時 | 2025-03-13 23:26:31 |
合計ジャッジ時間 | 2,013 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 20 |
ソースコード
K = int(input()) D = list(map(int,input().split())) ans = [] D.sort() top = 1 toph = 0 M = [1] for d in D: ans.append( (top+1,top+2,d//2) ) ans.append( (top+2,top,d//2 - toph) ) M.append(top+1) toph = d//2 top += 2 print (top) for u,v,w in ans: print (u,v,w) print (len(M)) print (*M)