結果
| 問題 | No.228 ゆきこちゃんの 15 パズル |
| コンテスト | |
| ユーザー |
aimy
|
| 提出日時 | 2017-09-03 14:23:47 |
| 言語 | Haskell (9.14.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 369 bytes |
| 記録 | |
| コンパイル時間 | 8,023 ms |
| コンパイル使用メモリ | 198,400 KB |
| 実行使用メモリ | 10,056 KB |
| 最終ジャッジ日時 | 2026-09-19 19:54:39 |
| 合計ジャッジ時間 | 9,716 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 9 WA * 8 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Data.Bool
import Data.List
main = getContents >>= putStrLn . bool "No" "Yes" . pazzle15 . map read . words
pazzle15 ns = null $ snd $ until (\(x,_) -> x==16) move (0, ds)
where
ds = filter (\(x,y) -> x /= y && elem (abs (x-y)) [1,4]) $ zip ns [1..16]
move (x,ds) = case find ((==x) . fst) ds of
Nothing -> (16, ds)
Just (x,y) -> (y, delete (x,y) ds)
aimy