結果
問題 |
No.3184 Make Same
|
ユーザー |
|
提出日時 | 2025-07-01 01:51:19 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,157 bytes |
コンパイル時間 | 511 ms |
コンパイル使用メモリ | 81,956 KB |
実行使用メモリ | 265,096 KB |
最終ジャッジ日時 | 2025-07-01 01:51:36 |
合計ジャッジ時間 | 16,734 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 1 WA * 23 |
ソースコード
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) anss.append((0, r-1, 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()