結果

問題 No.683 Two Operations No.3
ユーザー kerotono
提出日時 2018-05-11 22:36:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
MLE  
実行時間 -
コード長 441 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 826,752 KB
最終ジャッジ日時 2024-06-28 08:44:23
合計ジャッジ時間 3,930 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 MLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#!python
# -*- coding: utf-8 -*-

import sys

sys.setrecursionlimit(10 ** 8)


def DFS(A, B):
    if A == 0 and B == 0:
        return True
    if A % 2 == 1 and B % 2 == 1:
        return False

    if A % 2 == 1:
        return DFS(A - 1, B // 2)
    elif B % 2 == 1:
        return DFS(A // 2, B - 1)
    else:
        return DFS(A - 1, B // 2) or DFS(A // 2, B - 1)


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