結果

問題 No.3184 Make Same
ユーザー tkykwtnb
提出日時 2025-06-20 21:31:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 231 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 132,952 KB
最終ジャッジ日時 2025-06-20 21:31:23
合計ジャッジ時間 9,972 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
ans=[]
i=N-2
d=0
while i>=0:
    while i>0 and A[i]==A[i+1]:
        i-=1
    ans.append((1,i+1,A[-1]-A[i]-d))
    d+=A[-1]-A[i]-d
    i-=1
print(len(ans))
for a in ans:
    print(*a)
0