結果

問題 No.3184 Make Same
コンテスト
ユーザー hato336
提出日時 2025-06-20 21:28:30
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 269 ms / 2,000 ms
+ 333µs
コード長 642 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 234 ms
コンパイル使用メモリ 95,724 KB
実行使用メモリ 147,476 KB
最終ジャッジ日時 2026-07-12 14:50:24
合計ジャッジ時間 13,395 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
#input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
#a = []
#s = input()
#n,m = map(int,input().split())
#for i in range(n):
#    a.append(list(map(int,input().split())))
ans = []
t = 0
for i in reversed(range(30)):
    x = (1<<i)
    t += x
    y = bisect.bisect_left(a,t)
    if y == 0:continue
    ans.append((1,y,x))
    for j in range(y):
        a[j] += x
    a.sort()
    #print(a)
assert len(set(a)) == 1
print(len(ans))
for i in ans:
    print(*i)
0