結果

問題 No.1465 Archaea
ユーザー wolgnikwolgnik
提出日時 2020-07-28 00:10:12
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 225 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 480 ms
コンパイル使用メモリ 87,372 KB
実行使用メモリ 133,652 KB
最終ジャッジ日時 2023-08-25 16:06:36
合計ジャッジ時間 4,689 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,456 KB
testcase_01 AC 73 ms
71,168 KB
testcase_02 AC 78 ms
76,768 KB
testcase_03 AC 74 ms
76,252 KB
testcase_04 AC 71 ms
71,404 KB
testcase_05 AC 71 ms
71,420 KB
testcase_06 AC 71 ms
71,580 KB
testcase_07 AC 115 ms
90,776 KB
testcase_08 AC 76 ms
76,512 KB
testcase_09 AC 126 ms
90,976 KB
testcase_10 AC 70 ms
71,384 KB
testcase_11 AC 123 ms
90,968 KB
testcase_12 AC 80 ms
76,456 KB
testcase_13 AC 201 ms
126,812 KB
testcase_14 AC 124 ms
90,924 KB
testcase_15 AC 78 ms
76,416 KB
testcase_16 AC 79 ms
76,672 KB
testcase_17 AC 180 ms
111,440 KB
testcase_18 AC 82 ms
76,752 KB
testcase_19 AC 112 ms
88,984 KB
testcase_20 AC 166 ms
105,424 KB
testcase_21 AC 225 ms
133,652 KB
testcase_22 AC 223 ms
133,412 KB
testcase_23 AC 70 ms
71,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N, K  = map(int, input().split())
K = min(K, 30)
dp = [[0] * (K + 1) for _ in range(N + 1)]
dp[1][0] = 1
for i in range(N):
  for j in range(K):
    if i + 3 <= N: dp[i + 3][j + 1] |= dp[i][j]
    if i * 2 <= N: dp[i * 2][j + 1] |= dp[i][j]
if sum(dp[-1]): print("YES")
else: print("NO")
0