結果

問題 No.1465 Archaea
ユーザー qibqib
提出日時 2022-10-22 17:43:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 297 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 90,536 KB
最終ジャッジ日時 2023-09-14 11:24:38
合計ジャッジ時間 3,697 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,356 KB
testcase_01 AC 70 ms
71,324 KB
testcase_02 AC 73 ms
71,104 KB
testcase_03 AC 71 ms
71,408 KB
testcase_04 AC 71 ms
71,464 KB
testcase_05 AC 73 ms
71,160 KB
testcase_06 AC 71 ms
71,328 KB
testcase_07 WA -
testcase_08 AC 72 ms
71,056 KB
testcase_09 AC 88 ms
78,816 KB
testcase_10 AC 70 ms
71,348 KB
testcase_11 WA -
testcase_12 AC 71 ms
71,372 KB
testcase_13 AC 98 ms
87,624 KB
testcase_14 AC 88 ms
78,112 KB
testcase_15 AC 71 ms
71,304 KB
testcase_16 AC 72 ms
70,892 KB
testcase_17 WA -
testcase_18 AC 83 ms
76,276 KB
testcase_19 AC 91 ms
80,768 KB
testcase_20 AC 90 ms
80,836 KB
testcase_21 AC 102 ms
90,480 KB
testcase_22 AC 103 ms
90,536 KB
testcase_23 AC 71 ms
71,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

INF = 1 << 60

n, k = map(int, input().split())

dp = {}
dp[n] = 0
for x in range(n, 0, -3):
  dp[x] = min((n - x) // 3, dp.get(x, INF))
  cur = x
  while cur % 2 == 0:
  	dp[cur // 2] = min(dp.get(cur // 2, INF), dp[cur] + 1)
  	cur //= 2

if dp.get(1, INF) <= k:
	print("YES")
else:
	print("NO")
0