結果
問題 | No.1465 Archaea |
ユーザー |
|
提出日時 | 2021-04-02 21:58:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 458 bytes |
コンパイル時間 | 121 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 355,548 KB |
最終ジャッジ日時 | 2024-12-23 19:14:44 |
合計ジャッジ時間 | 11,649 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 TLE * 3 |
ソースコード
import sys sys.setrecursionlimit(10**6) n,k = map(int,input().split()) dic = {} def dfs(x,left): if (x,left) in dic: return dic[(x,left)] #print(x,left) if x < 1: return 0 if x == 1: return 1 if left == 0 and x != 1: return 0 check = 0 if x%2 == 0: check |= dfs(x//2,left-1) check |= dfs(x-3,left-1) dic[(x,left)] = check return check print("YES" if dfs(n,k) else "NO")