結果

問題 No.683 Two Operations No.3
ユーザー TsubajiroTsubajiro
提出日時 2022-05-16 21:52:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 529 bytes
コンパイル時間 818 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 71,588 KB
最終ジャッジ日時 2023-10-12 16:20:04
合計ジャッジ時間 2,792 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,560 KB
testcase_01 AC 72 ms
71,440 KB
testcase_02 AC 72 ms
71,524 KB
testcase_03 AC 71 ms
71,284 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 70 ms
71,404 KB
testcase_07 AC 68 ms
71,408 KB
testcase_08 AC 71 ms
71,220 KB
testcase_09 WA -
testcase_10 AC 69 ms
71,316 KB
testcase_11 AC 69 ms
71,476 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 70 ms
71,480 KB
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

while A>0 and B>0:
    if A>B:    
        if A%2==0:
            A//=2
            B-=1
        else:
            if B%2!=0:
                print("No")
                exit()
            else:
                B//=2
                A-=1
    else:
        if B%2==0:
            B//=2
            A-=1
        else:
            if A%2!=0:
                print("No")
                exit()
            else:
                A//=2
                B-=1
    
if A==0 or B==0:
    print("Yes")
0