結果
問題 | No.154 市バス |
ユーザー |
![]() |
提出日時 | 2016-06-19 03:23:22 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 67 ms / 2,000 ms |
コード長 | 828 bytes |
コンパイル時間 | 1,917 ms |
コンパイル使用メモリ | 173,568 KB |
実行使用メモリ | 7,936 KB |
最終ジャッジ日時 | 2024-10-13 08:30:26 |
合計ジャッジ時間 | 2,714 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 8 |
コンパイルメッセージ
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
ソースコード
LANGUAGELANGUAGEimportControl.ApplicativeimportControl.MonadimportControl.ArrowimportData.ListimportData.MaybeimportData.CharimportqualifiedData.ByteString.CharasBimportText.PrintfreadInt = ( readLn :: IO Int )readInts = map ( read :: String -> Int ) . words <$> getLinegetList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLinewhich a b f = if f then a else bmp [ a, b ] = ( a, b )main = getLine >> getContents >>= mapM_ putStrLn . map ( which "possible" "impossible" . f 0 0 0 . reverse ) . linesf 0 0 _ [] = Truef r g w ('R':s) = f ( r + 1 ) g w sf 0 _ _ ('G':s) = Falsef r g w ('G':s) = f ( r - 1 ) ( g + 1 ) w sf r 0 0 ('W':s) = Falsef r 0 w ('W':s) = f r 0 w sf r g w ('W':s) = f r ( g - 1 ) ( w + 1 ) sf _ _ _ _ = False