結果

問題 No.428 小数から逃げる夢
ユーザー Ysmr_Ry
提出日時 2016-12-23 20:56:05
言語 Haskell
(9.10.1)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 338 bytes
コンパイル時間 5,925 ms
コンパイル使用メモリ 171,444 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-14 17:03:48
合計ジャッジ時間 4,195 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 100
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

ソースコード

diff #

import Control.Monad
import Data.Char

main :: IO ()
main = do
  n <- readLn
  let rd = map digitToInt $ take 190 $ concatMap show [1..]
      (res, c) = foldr (f n) ([], 0) rd

  putStr $ show c
  putStr "."
  mapM_ (putStr . show) res
  putStrLn ""

  where
    f n x (res, c) = (x'`mod`10:res, x'`div`10)
      where
        x' = x*n+c
0