結果
問題 |
No.3184 Make Same
|
ユーザー |
|
提出日時 | 2025-07-01 02:00:38 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,178 bytes |
コンパイル時間 | 371 ms |
コンパイル使用メモリ | 82,056 KB |
実行使用メモリ | 264,788 KB |
最終ジャッジ日時 | 2025-07-01 02:00:59 |
合計ジャッジ時間 | 18,898 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 2 |
ソースコード
import bisect, collections, copy, heapq, itertools, math, string import sys def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int, sys.stdin.readline().rstrip().split()) def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) from collections import deque from collections import Counter from collections import defaultdict import bisect from functools import reduce from functools import lru_cache sys.setrecursionlimit(1000000) MOD = 10 ** 9 + 7 MOD99 = 998244353 def main(): N = I() A = LI() def check(A): if len(set(A)) == 1: return True else: return False ans = 0 anss = [] while not check(A): ans += 1 am = A[-1] now = 2 ** (len(bin(am)) - 3) r = bisect.bisect_left(A, now) if r != 0: anss.append((1, r, now)) for i in range(N): if A[i] >= now: A[i] -= now A.sort() print(ans) for l, r, v in anss: print(l, r, v) if __name__ == "__main__": main()