結果
問題 | No.240 ナイト散歩 |
ユーザー |
![]() |
提出日時 | 2025-02-21 12:35:21 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 602 bytes |
コンパイル時間 | 4,107 ms |
コンパイル使用メモリ | 67,400 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-02-21 12:35:26 |
合計ジャッジ時間 | 5,426 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
import sequtils, strscansconstm = [(1, 2),(1, -2),(2, 1),(2, -1),(-1, 2),(-1, -2),(-2, 1),(-2, -1),]varb = false.repeat(13).repeat(13)list = [@[(6, 6)], @[], @[], @[]]b[6][6] = truefor i in 0 ..< 3:for (lx, ly) in list[i]:for (mx, my) in m:if b[lx + mx][ly + my]:continueelse:b[lx + mx][ly + my] = truelist[i.succ].add (lx + mx, ly + my)let(_, x, y) = stdin.readLine.scanTuple "$i $i"if x.abs > 6 or y.abs > 6:echo "NO"quit()echo:if b[x.succ 6][y.succ 6]: "YES"else: "NO"