結果

問題 No.683 Two Operations No.3
ユーザー H3PO4H3PO4
提出日時 2020-11-24 11:44:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 360 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-07-23 18:26:41
合計ジャッジ時間 1,252 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 RE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import lru_cache


@lru_cache(None)
def rec(a, b):
    if a == b == 0:
        return True
    elif a % 2 and b % 2:
        return False

    res = False
    if not a % 2:
        res |= rec(a // 2, b - 1)
    if not b % 2:
        res |= rec(a - 1, b // 2)
    return res


A, B = map(int, input().split())
print('Yes' if rec(A, B) else 'No')
0