結果
問題 | No.99 ジャンピング駒 |
ユーザー |
|
提出日時 | 2018-01-20 21:55:50 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 14 ms / 5,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 6,688 ms |
コンパイル使用メモリ | 180,780 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-12-25 03:46:58 |
合計ジャッジ時間 | 7,488 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
コンパイルメッセージ
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
ソースコード
importControl.Applicative(<$>),importData.ListimportData.CharisSpaceimportData.ByteString.CharByteStringimportqualifiedData.ByteString.CharasBmain::IO()main = dosolve <$> readLn <*> readIntList >>= printsolve::Int->Int->Intsolve n xs = let en = foldl' f 0 xsin abs $ n - 2 * enwheref a y = if even y then a + 1 else areadIntList::IOIntreadIntList = unfoldr f <$> B.getLinewheref s = do(n, s') <- B.readInt sreturn (n, B.dropWhile isSpace s')