結果

問題 No.683 Two Operations No.3
ユーザー rlangevinrlangevin
提出日時 2023-03-13 08:59:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 414 bytes
コンパイル時間 568 ms
コンパイル使用メモリ 11,784 KB
実行使用メモリ 824,156 KB
最終ジャッジ日時 2023-10-18 10:55:02
合計ジャッジ時間 3,488 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 AC 29 ms
10,096 KB
testcase_02 AC 28 ms
10,096 KB
testcase_03 AC 29 ms
10,096 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)

def f(a, b):
    if a == 0 and b == 0:
        return 1
    if a == 0 and b != 1:
        return 0
    if a == b and a != 1:
        return 0
    
    v = 0
    if a > b:
        v |= f(b, a)
    if a % 2 == 0:
        v |= f(a//2, b - 1)
    if b % 2 == 0:
        v |= f(a - 1, b//2)
    return v

A, B = map(int, input().split())
print("Yes") if f(A, B) else print("No")
0