結果
問題 | No.683 Two Operations No.3 |
ユーザー | prd_xxx |
提出日時 | 2018-05-11 22:57:35 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 570 bytes |
コンパイル時間 | 279 ms |
コンパイル使用メモリ | 10,764 KB |
実行使用メモリ | 816,092 KB |
最終ジャッジ日時 | 2023-09-10 17:45:20 |
合計ジャッジ時間 | 3,851 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 67 ms
16,868 KB |
testcase_01 | AC | 66 ms
16,804 KB |
testcase_02 | AC | 66 ms
16,828 KB |
testcase_03 | AC | 67 ms
16,824 KB |
testcase_04 | MLE | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
ソースコード
import sys sys.setrecursionlimit(10**7) X,Y = map(int,input().split()) N = 1000 mem = [[None for i in range(N)] for j in range(N)] def dfs(x,y): if x == y == 0: return True if x < 0 or y < 0: return False if x%2 and y%2: return False if x < N and y < N and mem[x][y] is not None: return mem[x][y] if x%2: ret = dfs(x-1,y//2) elif y%2: ret = dfs(x//2,y-1) else: ret = dfs(x-1,y//2) or dfs(x//2,y-1) if x < N and y < N: mem[x][y] = mem[y][x] = ret return ret print('Yes' if dfs(X,Y) else 'No')