結果
問題 |
No.1465 Archaea
|
ユーザー |
![]() |
提出日時 | 2021-05-05 19:48:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 178 ms / 2,000 ms |
コード長 | 573 bytes |
コンパイル時間 | 158 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-09-13 12:39:55 |
合計ジャッジ時間 | 5,310 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
import sys def input(): return sys.stdin.readline().rstrip() """ Do not get stuck on a problem for more than 20 minutes Just check the editorial :) There should be something else to do insead """ MAXN = 200010 INF = 1 << 128 DP = [INF]*(MAXN) DP[1] = 0 for i in range(1,MAXN): if i % 2 == 0: DP[i] = min(DP[i],DP[i//2] + 1,DP[i-3] + 1) else: DP[i] = min(DP[i],DP[i-3] + 1) def main(): n,k = map(int,input().split()) if DP[n] <= k: print("YES") else: print("NO") return if __name__ == "__main__": main()