結果

問題 No.683 Two Operations No.3
ユーザー konsin_tokagekonsin_tokage
提出日時 2018-05-12 22:13:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 246 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 10,492 KB
実行使用メモリ 7,936 KB
最終ジャッジ日時 2023-09-10 18:32:24
合計ジャッジ時間 1,137 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 17 ms
7,828 KB
testcase_02 WA -
testcase_03 AC 17 ms
7,860 KB
testcase_04 AC 16 ms
7,936 KB
testcase_05 AC 16 ms
7,792 KB
testcase_06 AC 16 ms
7,796 KB
testcase_07 WA -
testcase_08 AC 16 ms
7,908 KB
testcase_09 AC 17 ms
7,756 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 16 ms
7,804 KB
testcase_13 AC 15 ms
7,860 KB
testcase_14 WA -
testcase_15 AC 16 ms
7,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(int, input().split())
vis = set()
def dfs(x, y):
    if x>=a or y>=b:
        return x==a and y==b
    vis.add((x,y))
    return (x,y) not in vis and (dfs(x+1, y*2) or dfs(x*2, y+1))
if dfs(a, b):
    print('Yes')
else:
    print('No')
0