結果

問題 No.683 Two Operations No.3
ユーザー kerotonokerotono
提出日時 2018-05-11 22:36:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 441 bytes
コンパイル時間 964 ms
コンパイル使用メモリ 10,828 KB
実行使用メモリ 817,752 KB
最終ジャッジ日時 2023-09-10 17:35:41
合計ジャッジ時間 4,479 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

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