結果
問題 |
No.240 ナイト散歩
|
ユーザー |
![]() |
提出日時 | 2017-05-16 00:21:05 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 857 bytes |
コンパイル時間 | 91 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-09-16 08:12:04 |
合計ジャッジ時間 | 2,527 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 27 WA * 3 |
ソースコード
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")