結果
| 問題 | No.240 ナイト散歩 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-18 00:45:43 |
| 言語 | Standard ML (MLton 20241230) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 717 bytes |
| 記録 | |
| コンパイル時間 | 3,483 ms |
| コンパイル使用メモリ | 705,124 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-18 00:45:54 |
| 合計ジャッジ時間 | 9,879 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
fun readLargeInt () =
valOf (TextIO.scanStream (LargeInt.scan StringCvt.DEC) TextIO.stdIn)
fun canReach _ 0 0 = true
| canReach 0 _ _ = false
| canReach n x y =
canReach (n - 1) (x - 2) (y - 1) orelse
canReach (n - 1) (x - 2) (y + 1) orelse
canReach (n - 1) (x - 1) (y - 2) orelse
canReach (n - 1) (x - 1) (y + 2) orelse
canReach (n - 1) (x + 1) (y - 2) orelse
canReach (n - 1) (x + 1) (y + 2) orelse
canReach (n - 1) (x + 2) (y - 1) orelse
canReach (n - 1) (x + 2) (y + 1)
val () =
let
val x = readLargeInt ()
val y = readLargeInt ()
val ans = if canReach 3 x y then "YES"
else "NO"
in
print (ans ^ "\n")
end