結果
問題 | No.683 Two Operations No.3 |
ユーザー | roaris |
提出日時 | 2019-09-01 20:01:13 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 448 bytes |
コンパイル時間 | 387 ms |
コンパイル使用メモリ | 86,948 KB |
実行使用メモリ | 835,196 KB |
最終ジャッジ日時 | 2023-08-19 12:14:38 |
合計ジャッジ時間 | 4,801 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 80 ms
71,160 KB |
testcase_01 | AC | 81 ms
71,432 KB |
testcase_02 | AC | 77 ms
71,432 KB |
testcase_03 | AC | 76 ms
71,388 KB |
testcase_04 | AC | 76 ms
71,492 KB |
testcase_05 | AC | 76 ms
71,336 KB |
testcase_06 | MLE | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
ソースコード
import sys sys.setrecursionlimit(10 ** 6) def dfs(A, B): if A == 0 and B == 0: return True elif A % 2 == 0 and B % 2 == 0 and A > 0 and B > 0: return dfs(A//2, B-1) or dfs(A-1, B//2) elif A % 2 == 0 and B > 0: return dfs(A//2, B-1) elif B % 2 == 0 and A > 0: return dfs(A-1, B//2) else: return False A, B = map(int, input().split()) if dfs(A, B): print('Yes') else: print('No')