結果

問題 No.683 Two Operations No.3
ユーザー ayaoniayaoni
提出日時 2021-01-03 23:01:43
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 772 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 82,388 KB
実行使用メモリ 845,808 KB
最終ジャッジ日時 2024-04-21 17:50:36
合計ジャッジ時間 3,311 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,224 KB
testcase_01 AC 38 ms
51,712 KB
testcase_02 AC 38 ms
51,840 KB
testcase_03 AC 38 ms
51,968 KB
testcase_04 AC 39 ms
52,224 KB
testcase_05 AC 39 ms
52,480 KB
testcase_06 MLE -
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 I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


A,B = MI()


def f(X,Y):
    if X == Y == 0:
        return True
    if X < 0 or Y < 0:
        return False
    if X % 2 == Y % 2 == 1:
        return False
    if X % 2 == 0 and f(X//2,Y-1):
        return True
    if Y % 2 == 0 and f(X-1,Y//2):
        return True
    return False


print('Yes' if f(A,B) else 'No')
0