結果

問題 No.683 Two Operations No.3
ユーザー tktk_snsntktk_snsn
提出日時 2021-01-16 08:57:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 449 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 10,572 KB
実行使用メモリ 817,096 KB
最終ジャッジ日時 2023-08-18 05:27:58
合計ジャッジ時間 2,637 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,612 KB
testcase_01 AC 20 ms
8,764 KB
testcase_02 AC 21 ms
8,580 KB
testcase_03 AC 21 ms
8,620 KB
testcase_04 MLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import lru_cache
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)


@lru_cache(maxsize=None)
def dfs(a, b):
    if a == 0 and b == 0:
        return True

    if a % 2 == 0:
        if dfs(a // 2, b - 1):
            return True
    if b % 2 == 0:
        if dfs(a - 1, b // 2):
            return True
    return False


A, B = map(int, input().split())
if dfs(A, B):
    print("Yes")
else:
    print("No")
0