結果

問題 No.240 ナイト散歩
ユーザー NoNo
提出日時 2017-05-16 00:21:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 857 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 11,036 KB
実行使用メモリ 8,368 KB
最終ジャッジ日時 2023-10-14 13:28:38
合計ジャッジ時間 2,020 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,288 KB
testcase_01 AC 14 ms
8,164 KB
testcase_02 AC 15 ms
8,192 KB
testcase_03 AC 15 ms
8,320 KB
testcase_04 AC 14 ms
8,192 KB
testcase_05 WA -
testcase_06 AC 15 ms
8,196 KB
testcase_07 AC 15 ms
8,304 KB
testcase_08 AC 15 ms
8,340 KB
testcase_09 AC 15 ms
8,144 KB
testcase_10 AC 14 ms
8,296 KB
testcase_11 AC 15 ms
8,316 KB
testcase_12 AC 15 ms
7,832 KB
testcase_13 AC 14 ms
8,288 KB
testcase_14 AC 15 ms
8,320 KB
testcase_15 AC 15 ms
8,300 KB
testcase_16 AC 15 ms
8,360 KB
testcase_17 AC 18 ms
8,212 KB
testcase_18 AC 14 ms
8,160 KB
testcase_19 AC 15 ms
8,308 KB
testcase_20 AC 15 ms
8,160 KB
testcase_21 AC 15 ms
8,368 KB
testcase_22 AC 15 ms
8,360 KB
testcase_23 AC 15 ms
8,364 KB
testcase_24 AC 15 ms
8,304 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 15 ms
8,140 KB
testcase_29 AC 15 ms
8,160 KB
testcase_30 AC 14 ms
8,172 KB
testcase_31 AC 15 ms
8,344 KB
testcase_32 AC 15 ms
8,344 KB
testcase_33 AC 15 ms
8,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def add(a = 0,b = 0):
    s = str(a) + "," + str(b)
    if s not in li2:
        li2.append(s)

ss = input().split()
z = ss[0] + "," + ss[1]

li = ["0,0"]
li2 = []
f = 0

for i in range(3):
    for j in range(f,len(li)):
        ss = li[j].split(',')
        x = int(ss[0])
        y = int(ss[1])

        a = x - 2
        b = y - 1
        add(a,b)

        a = x - 2
        b = y + 1
        add(a,b)

        a = x - 1
        b = y - 2
        add(a,b)

        a = x - 1
        b = y + 2
        add(a,b)

        a = x + 1
        b = y - 2
        add(a,b)

        a = x + 1
        b = y + 2
        add(a,b)

        a = x + 2
        b = y - 1
        add(a,b)

        a = x + 2
        b = y + 1 
        add(a,b)
    
        f = len(li) - 1 
        li += li2
        li2.clear()
        
if z in li:
    print("YES")
else:
    print("NO")
0