結果
| 問題 |
No.3184 Make Same
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-06-24 10:15:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 311 ms / 2,000 ms |
| コード長 | 464 bytes |
| コンパイル時間 | 510 ms |
| コンパイル使用メモリ | 82,324 KB |
| 実行使用メモリ | 168,328 KB |
| 最終ジャッジ日時 | 2025-06-24 10:15:19 |
| 合計ジャッジ時間 | 14,295 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
N = int(input())
A = list(map(int,input().split()))
ans = []
amax = A[-1]
while A[0]<amax:
dmax = A[1]
v = amax-A[0]
ind = 0
for i in range(1,N):
if A[i]==amax:break
d = amax-A[i]
l = min(A[0]+d,A[i+1])
if l>dmax:
dmax = l
ind = i
ans.append((1,ind+1,amax-A[ind]))
for i in range(ind+1):
A[i] += amax-A[ind]
A = sorted(A)
print(len(ans))
for l,r,v in ans:
print(l,r,v)