結果

問題 No.683 Two Operations No.3
ユーザー H3PO4H3PO4
提出日時 2020-11-24 11:42:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 354 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 820,032 KB
最終ジャッジ日時 2023-10-01 00:51:00
合計ジャッジ時間 4,961 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 AC 17 ms
7,888 KB
testcase_02 AC 15 ms
7,896 KB
testcase_03 AC 16 ms
7,764 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 #

import sys

sys.setrecursionlimit(10 ** 9)


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