結果

問題 No.683 Two Operations No.3
ユーザー tktk_snsn
提出日時 2021-01-16 08:59:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-27 08:30:23
合計ジャッジ時間 1,459 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

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


def dfs(a, b):
    if a == 0 or 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