結果
問題 |
No.154 市バス
|
ユーザー |
![]() |
提出日時 | 2017-06-16 17:24:53 |
言語 | Haskell (9.10.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 278 bytes |
コンパイル時間 | 1,817 ms |
コンパイル使用メモリ | 171,844 KB |
実行使用メモリ | 8,064 KB |
最終ジャッジ日時 | 2024-10-13 09:04:32 |
合計ジャッジ時間 | 2,854 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 6 WA * 2 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Data.Bool main = getLine >> interact (unlines . map (bool "impossible" "possible" . bus) . lines) bus m = all (all (>=0)) wgs && last (last wgs) == 0 where wgs = scanl asum [0,0] m asum [w,g] 'W' = [w+1, g] asum [w,g] 'G' = [w-1, g+1] asum [w,g] 'R' = [w, g-1]