結果
問題 | No.170 スワップ文字列(Easy) |
ユーザー |
![]() |
提出日時 | 2015-03-22 23:40:00 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 572 bytes |
コンパイル時間 | 5,289 ms |
コンパイル使用メモリ | 173,184 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 04:41:57 |
合計ジャッジ時間 | 6,151 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
コンパイルメッセージ
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.ApplicativeimportControl.MonadimportqualifiedData.ByteString.CharasBimportData.MaybefromJustimportText.PrintfimportData.ListimportDebug.Trace-- or readIntegerreadInts::BByteString->IntreadInts = map (fst . fromJust . B.readInt) . B.wordsgetInts::IOIntgetInts = liftM readInts B.getLinef n [] = 1f n (x:xs) = c n x * f (n-x) xswhere c n m = product [1..n] `div` product [1..m] `div` product [1..(n-m)]g::String->Intg = map length . group . sortmain = dos <- getLineprint $ (f (length s) $ g s) - 1