結果

問題 No.683 Two Operations No.3
ユーザー ああいいああいい
提出日時 2021-12-29 17:44:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 275 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-14 23:25:49
合計ジャッジ時間 1,264 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

import sys
q = [(A,B)]
while len(q):
    a,b = q.pop()
    if a == 0 or 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