結果

問題 No.240 ナイト散歩
ユーザー gorugo30gorugo30
提出日時 2021-03-17 23:18:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 54,416 KB
最終ジャッジ日時 2024-04-27 15:06:03
合計ジャッジ時間 3,715 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
53,892 KB
testcase_01 AC 40 ms
52,888 KB
testcase_02 AC 40 ms
53,296 KB
testcase_03 AC 42 ms
53,412 KB
testcase_04 AC 40 ms
52,996 KB
testcase_05 AC 42 ms
53,012 KB
testcase_06 AC 39 ms
52,124 KB
testcase_07 AC 42 ms
53,364 KB
testcase_08 AC 39 ms
52,504 KB
testcase_09 AC 40 ms
53,072 KB
testcase_10 AC 40 ms
54,416 KB
testcase_11 AC 41 ms
52,944 KB
testcase_12 AC 41 ms
52,952 KB
testcase_13 AC 40 ms
52,828 KB
testcase_14 AC 40 ms
54,088 KB
testcase_15 AC 41 ms
53,492 KB
testcase_16 AC 39 ms
52,956 KB
testcase_17 AC 41 ms
52,392 KB
testcase_18 AC 39 ms
53,076 KB
testcase_19 AC 39 ms
52,004 KB
testcase_20 AC 40 ms
52,464 KB
testcase_21 AC 39 ms
52,636 KB
testcase_22 AC 40 ms
52,380 KB
testcase_23 AC 42 ms
52,008 KB
testcase_24 AC 40 ms
52,396 KB
testcase_25 AC 39 ms
53,468 KB
testcase_26 AC 39 ms
52,620 KB
testcase_27 AC 40 ms
52,420 KB
testcase_28 AC 40 ms
53,260 KB
testcase_29 AC 39 ms
53,576 KB
testcase_30 AC 39 ms
52,860 KB
testcase_31 AC 40 ms
52,272 KB
testcase_32 AC 40 ms
52,280 KB
testcase_33 AC 38 ms
52,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X, Y = map(int, input().split())
dx = [-2, -2, -1, -1, 1, 1, 2, 2]
dy = [-1, 1, -2, 2, -2, 2, -1, 1]
can = [set() for i in range(4)]
can[0].add((0, 0))
for i in range(1, 4):
    for x, y in can[i - 1]:
        for d in range(8):
            can[i].add((x + dx[d], y + dy[d]))

if (X, Y) in can[0] or (X, Y) in can[1] or (X, Y) in can[2] or (X, Y) in can[3]:
    print("YES")
else:
    print("NO")
0