結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー aimyaimy
提出日時 2017-06-12 10:33:39
言語 Haskell
(9.8.2)
結果
AC  
実行時間 906 ms / 5,000 ms
コード長 459 bytes
コンパイル時間 8,893 ms
コンパイル使用メモリ 174,464 KB
実行使用メモリ 108,416 KB
最終ジャッジ日時 2024-04-25 23:55:11
合計ジャッジ時間 28,198 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 906 ms
108,416 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 311 ms
35,712 KB
testcase_03 AC 594 ms
66,304 KB
testcase_04 AC 715 ms
66,304 KB
testcase_05 AC 719 ms
66,432 KB
testcase_06 AC 734 ms
66,304 KB
testcase_07 AC 826 ms
81,024 KB
testcase_08 AC 810 ms
80,896 KB
testcase_09 AC 822 ms
81,024 KB
testcase_10 AC 661 ms
62,208 KB
testcase_11 AC 671 ms
64,384 KB
testcase_12 AC 682 ms
60,416 KB
testcase_13 AC 740 ms
66,304 KB
testcase_14 AC 763 ms
66,304 KB
testcase_15 AC 691 ms
66,304 KB
testcase_16 AC 664 ms
66,432 KB
testcase_17 AC 630 ms
66,304 KB
testcase_18 AC 612 ms
66,432 KB
testcase_19 AC 804 ms
81,024 KB
testcase_20 AC 801 ms
80,896 KB
testcase_21 AC 798 ms
81,024 KB
testcase_22 AC 603 ms
62,208 KB
testcase_23 AC 586 ms
64,512 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 19 ms
9,984 KB
testcase_26 AC 9 ms
8,704 KB
testcase_27 AC 7 ms
8,448 KB
testcase_28 AC 126 ms
21,248 KB
testcase_29 AC 66 ms
15,488 KB
testcase_30 AC 20 ms
9,984 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 Data.Int
import Text.Printf

apply n f x = foldr ($) x (replicate n f)

lmin = 10**(-9) :: Double
lmax = 10**9 :: Double

main = do
 getLine
 ls <- map (fromIntegral . (read::String->Integer)) . words <$> getLine
 k <- readLn
 printf "%.12f\n" (yokuaru k ls)

yokuaru k ls = snd $ apply 60 (bsearch k ls) (lmin,lmax)

bsearch k ls (lo,hi)
 | cuts md ls < k = (lo,md)
 | otherwise = (md,hi)
 where
  md = (lo + hi) / 2

cuts x = sum . map (floor . (/x))
0