結果

問題 No.683 Two Operations No.3
ユーザー roarisroaris
提出日時 2019-09-01 20:10:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 406 bytes
コンパイル時間 348 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 297,336 KB
最終ジャッジ日時 2023-08-19 12:26:02
合計ジャッジ時間 4,212 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,960 KB
testcase_01 AC 15 ms
7,796 KB
testcase_02 AC 16 ms
7,840 KB
testcase_03 AC 16 ms
7,796 KB
testcase_04 TLE -
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 ** 6)

def dfs(A, B):
    if A == 0 and B == 0:
        return True
    
    res = False
    
    if A % 2 == 0 and B > 0:
        res |= dfs(A//2, B-1)
    if B % 2 == 0 and A > 0:
        res |= dfs(A-1, B//2)
   
    return res

def main():
    A, B = map(int, input().split())
    
    if dfs(A, B):
        print('Yes')
    else:
        print('No')
        
main()
0