結果
問題 | No.428 小数から逃げる夢 |
ユーザー |
![]() |
提出日時 | 2016-10-02 23:07:56 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 889 bytes |
コンパイル時間 | 9,423 ms |
コンパイル使用メモリ | 172,288 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-21 13:31:27 |
合計ジャッジ時間 | 7,725 ms |
ジャッジサーバーID (参考情報) |
judge5 / 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 ) Main.hs:24:1: warning: [GHC-94817] [-Wtabs] Tab character found here, and in 18 further locations. Suggested fix: Please use spaces instead. | 24 | n :: Integer <- readLn | ^^^^^^^^ [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 )d = 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991main = don::IntegerreadLnletdd = d * ns1 = show ds2 = show ddl1 = length s1l2 = length s2k = l2 - l1if k == 0then printf "0.%s\n" $ s2else printf "%s.%s\n" ( take k s2 ) ( drop k s2 )