結果

問題 No.240 ナイト散歩
ユーザー yakeshibayakeshiba
提出日時 2020-09-27 02:59:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 10,952 KB
実行使用メモリ 8,432 KB
最終ジャッジ日時 2023-09-12 15:34:23
合計ジャッジ時間 2,460 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,340 KB
testcase_01 AC 18 ms
8,260 KB
testcase_02 AC 18 ms
8,188 KB
testcase_03 AC 18 ms
8,212 KB
testcase_04 AC 17 ms
8,284 KB
testcase_05 AC 17 ms
8,224 KB
testcase_06 AC 18 ms
8,360 KB
testcase_07 AC 17 ms
8,176 KB
testcase_08 AC 18 ms
8,348 KB
testcase_09 AC 18 ms
8,212 KB
testcase_10 AC 18 ms
8,344 KB
testcase_11 AC 18 ms
8,232 KB
testcase_12 AC 17 ms
8,344 KB
testcase_13 AC 18 ms
8,204 KB
testcase_14 AC 17 ms
8,176 KB
testcase_15 AC 17 ms
8,260 KB
testcase_16 AC 17 ms
8,372 KB
testcase_17 AC 18 ms
8,180 KB
testcase_18 AC 18 ms
8,284 KB
testcase_19 AC 18 ms
8,180 KB
testcase_20 AC 17 ms
8,184 KB
testcase_21 AC 17 ms
8,180 KB
testcase_22 AC 17 ms
8,232 KB
testcase_23 AC 17 ms
8,292 KB
testcase_24 AC 18 ms
8,212 KB
testcase_25 AC 17 ms
8,296 KB
testcase_26 AC 18 ms
8,360 KB
testcase_27 AC 17 ms
8,224 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 18 ms
8,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

dx = [-2,-2,-1,-1,1,1,2,2]
dy = [-1,1,-2,2,-2,2,-1,1]

ans = [(0,0)]
def dfs(x, y, i):
    if i == 4:
        return 
    for dxi, dyi in zip(dx, dy):
        ans.append((x+dxi,y+dyi))
        dfs(x+dxi, y+dyi, i+1)

X,Y = map(int,input().split())    
dfs(0, 0, 0)

#print(ans)

if (X,Y) in ans:
    print('YES')
else:
    print('NO')
0