結果

問題 No.240 ナイト散歩
ユーザー yaoshimaxyaoshimax
提出日時 2016-02-23 02:30:52
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 463 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 6,508 KB
実行使用メモリ 6,064 KB
最終ジャッジ日時 2023-07-29 13:42:06
合計ジャッジ時間 1,745 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
5,996 KB
testcase_01 AC 10 ms
5,864 KB
testcase_02 AC 9 ms
5,860 KB
testcase_03 AC 10 ms
5,988 KB
testcase_04 AC 10 ms
5,864 KB
testcase_05 AC 9 ms
6,044 KB
testcase_06 AC 11 ms
5,860 KB
testcase_07 AC 10 ms
5,876 KB
testcase_08 AC 9 ms
5,932 KB
testcase_09 AC 9 ms
5,876 KB
testcase_10 AC 10 ms
5,988 KB
testcase_11 AC 9 ms
6,000 KB
testcase_12 AC 9 ms
5,928 KB
testcase_13 AC 9 ms
5,936 KB
testcase_14 AC 9 ms
5,864 KB
testcase_15 AC 9 ms
5,940 KB
testcase_16 AC 9 ms
5,872 KB
testcase_17 AC 12 ms
5,980 KB
testcase_18 AC 10 ms
5,912 KB
testcase_19 AC 9 ms
5,928 KB
testcase_20 AC 9 ms
5,996 KB
testcase_21 AC 9 ms
5,952 KB
testcase_22 AC 10 ms
6,064 KB
testcase_23 AC 9 ms
5,980 KB
testcase_24 AC 9 ms
5,928 KB
testcase_25 AC 10 ms
5,996 KB
testcase_26 AC 9 ms
5,872 KB
testcase_27 AC 10 ms
5,944 KB
testcase_28 AC 9 ms
5,876 KB
testcase_29 AC 10 ms
6,000 KB
testcase_30 AC 10 ms
5,864 KB
testcase_31 AC 9 ms
6,000 KB
testcase_32 AC 9 ms
6,000 KB
testcase_33 AC 10 ms
5,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

table=[[False for i in range(15)] for j in range(15)]
L=[(0,0)]
table[6][6]=True
for r in range(3):
    M=[]
    for x,y in L:
#        print x,y
        for dx,dy in [(-2,-1),(-2,+1),(-1,-2),(-1,+2),(+1,-2),(+1,+2),(+2,-1),(+2,+1)]:
            M.append((x+dx,y+dy))
            table[x+dx+6][y+dy+6]=True
    L=M

X,Y=map(int,raw_input().split())
if X<-6 or X>6 or Y<-6 or Y>6:
    print "NO"
    exit()
if table[X+6][Y+6]:
    print "YES"
else:
    print "NO"
0