結果

問題 No.683 Two Operations No.3
ユーザー NiER_Replicant6NiER_Replicant6
提出日時 2018-05-13 13:23:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 308 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 8,628 KB
最終ジャッジ日時 2023-09-10 18:48:51
合計ジャッジ時間 1,413 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 RE -
testcase_05 RE -
testcase_06 WA -
testcase_07 RE -
testcase_08 WA -
testcase_09 RE -
testcase_10 WA -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(int, input().split())

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

if dfs(a,b)==True:
    print("True")
0