結果
問題 | No.2056 非力なレッド |
ユーザー | RyoSci |
提出日時 | 2022-08-26 22:57:38 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 109 ms / 2,000 ms |
コード長 | 644 bytes |
コンパイル時間 | 148 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 105,088 KB |
最終ジャッジ日時 | 2024-10-13 23:34:54 |
合計ジャッジ時間 | 4,247 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
# import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') import sys sys.setrecursionlimit(10**7) def input(): return sys.stdin.readline().rstrip() INF = 10**18 n, x, m = map(int, input().split()) a = list(map(int, input().split())) cnts = [0]*n for i in range(n): tmp = a[i] cnt = 0 while tmp >= x: tmp //= 2 cnt += 1 cnts[i] = cnt now = 0 for k in range(n, 0, -1): cnts[k-1] = max(0, cnts[k-1]-now) while cnts[k-1] > 0: if not (1 <= k <= min(n, m)): break now += 1 cnts[k-1] -= 1 m -= k if sum(cnts) == 0: print("Yes") else: print("No")