結果

問題 No.683 Two Operations No.3
ユーザー prd_xxxprd_xxx
提出日時 2018-05-11 22:39:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 312 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 816,992 KB
最終ジャッジ日時 2023-09-10 17:37:51
合計ジャッジ時間 3,192 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

X,Y = map(int,input().split())

def dfs(x,y):
    if x == y == 0: return True
    if x%2 and y%2: return False
    if x%2:
        return dfs(x-1,y//2)
    if y%2:
        return dfs(x//2,y-1)
    return dfs(x-1,y//2) or dfs(x//2,y-1)

print('Yes' if dfs(X,Y) else 'No')
0