結果

問題 No.683 Two Operations No.3
ユーザー ああいいああいい
提出日時 2021-12-29 17:43:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 276 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 21,632 KB
最終ジャッジ日時 2024-04-14 23:24:41
合計ジャッジ時間 3,849 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

A,B = map(int,input().split())

import sys
q = [(A,B)]
while len(q):
    a,b = q.pop()
    if a == 0 and b == 0:
        print('Yes')
        exit()
    if a & 1 == 0 and b > 0:
        q.append((a//2,b-1))
    if a > 0 and b & 1 == 0:
        q.append(a-1,b // 2)
print('No')
0