結果

問題 No.683 Two Operations No.3
コンテスト
ユーザー kerotono
提出日時 2018-05-11 22:36:18
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
MLE  
実行時間 -
コード長 441 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 932 ms
コンパイル使用メモリ 21,412 KB
実行使用メモリ 1,309,952 KB
最終ジャッジ日時 2026-07-31 19:22:51
合計ジャッジ時間 4,333 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 MLE * 2 -- * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!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