結果
| 問題 | No.683 Two Operations No.3 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-05-11 22:25:56 | 
| 言語 | PyPy2 (7.3.15) | 
| 結果 | 
                                MLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 466 bytes | 
| コンパイル時間 | 1,577 ms | 
| コンパイル使用メモリ | 76,800 KB | 
| 実行使用メモリ | 785,436 KB | 
| 最終ジャッジ日時 | 2024-06-28 04:07:39 | 
| 合計ジャッジ時間 | 8,198 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | MLE * 1 -- * 15 | 
ソースコード
a, b = map(int, raw_input().split())
stack = [(0, 0)]
d = set()
while len(stack) > 0:
    x, y = stack[-1]
    stack.pop()
    if x == a and y == b:
        print "Yes"
        exit()
    if (x, y) in d:
        continue
    d.add((x, y))
    aa = x*2
    bb = y+1
    if aa <= a and bb <= b and (aa, bb) not in d:
        stack.append((aa, bb))
    aa = x+1
    bb = y*2
    if aa <= a and bb <= b and (aa, bb) not in d:
        stack.append((aa, bb))
print "No"
            
            
            
        