結果

問題 No.683 Two Operations No.3
ユーザー lam6er
提出日時 2025-04-15 23:43:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 520 bytes
コンパイル時間 493 ms
コンパイル使用メモリ 82,340 KB
実行使用メモリ 54,012 KB
最終ジャッジ日時 2025-04-15 23:46:47
合計ジャッジ時間 1,775 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(int, input().split())

if a == 0 or b == 0:
    print("Yes" if a + b == 0 else "Yes")
else:
    while a % 2 == 0 and b % 2 == 0:
        a //= 2
        b //= 2
    while True:
        if a == 0 or b == 0:
            break
        if a % 2 == 0:
            a //= 2
            b -= 1
        elif b % 2 == 0:
            a -= 1
            b //= 2
        else:
            break
        while a % 2 == 0 and b % 2 == 0:
            a //= 2
            b //= 2
    print("Yes" if a == 0 or b == 0 else "No")
0