結果
| 問題 |
No.3057 Tree Distance Set
|
| コンテスト | |
| ユーザー |
ゼット
|
| 提出日時 | 2025-03-14 21:31:06 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 55 ms / 2,000 ms |
| コード長 | 408 bytes |
| コンパイル時間 | 269 ms |
| コンパイル使用メモリ | 82,172 KB |
| 実行使用メモリ | 60,480 KB |
| 最終ジャッジ日時 | 2025-03-14 21:31:08 |
| 合計ジャッジ時間 | 2,476 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 20 |
ソースコード
N=int(input())
A=list(map(int,input().split()))
L=[]
h=[]
x=1
c=0
A.sort()
for i in range(N):
y=A[i]
if i==0:
h.append(1)
h.append(2)
L.append((x,3,y//2))
L.append((2,3,y//2))
c=y//2
x=3
else:
h.append(x+1)
L.append((x,x+2,y//2-c))
L.append((x+1,x+2,y//2))
c=y//2
x+=2
print(x)
for i in range(len(L)):
a,b,c=L[i][:]
print(a,b,c)
print(len(h))
print(*h)
ゼット