結果

問題 No.3184 Make Same
ユーザー yupooh
提出日時 2025-06-20 21:34:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 174 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 82,848 KB
実行使用メモリ 121,472 KB
最終ジャッジ日時 2025-06-20 21:35:07
合計ジャッジ時間 10,977 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
ans=[]
while a[-1]-a[0]>0:
  sa=a[-1]-a[0]
  for i in range(n):
    if a[i]>a[0]+sa//2:
      idx=i
      break
  for i in range(idx):
    a[i]+=(sa//2+1)
  a.sort()
  ans.append((1,idx,sa//2+1))
print(len(ans))
for i in ans:
  print(*i)
0