結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー aimyaimy
提出日時 2017-06-12 09:04:51
言語 Haskell
(9.8.2)
結果
AC  
実行時間 4,947 ms / 5,000 ms
コード長 494 bytes
コンパイル時間 2,842 ms
コンパイル使用メモリ 165,060 KB
実行使用メモリ 112,768 KB
最終ジャッジ日時 2023-10-24 21:38:28
合計ジャッジ時間 106,639 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4,407 ms
112,768 KB
testcase_01 AC 4 ms
6,480 KB
testcase_02 AC 1,713 ms
36,992 KB
testcase_03 AC 3,295 ms
66,688 KB
testcase_04 AC 4,275 ms
66,688 KB
testcase_05 AC 4,323 ms
66,688 KB
testcase_06 AC 4,406 ms
66,688 KB
testcase_07 AC 4,576 ms
96,384 KB
testcase_08 AC 4,568 ms
96,384 KB
testcase_09 AC 4,588 ms
96,384 KB
testcase_10 AC 3,895 ms
63,616 KB
testcase_11 AC 4,076 ms
65,664 KB
testcase_12 AC 3,724 ms
61,568 KB
testcase_13 AC 4,167 ms
82,320 KB
testcase_14 AC 4,387 ms
88,192 KB
testcase_15 AC 3,846 ms
66,688 KB
testcase_16 AC 4,496 ms
66,688 KB
testcase_17 AC 4,446 ms
66,688 KB
testcase_18 AC 4,417 ms
66,688 KB
testcase_19 AC 4,939 ms
96,384 KB
testcase_20 AC 4,947 ms
96,384 KB
testcase_21 AC 4,918 ms
96,384 KB
testcase_22 AC 3,994 ms
63,616 KB
testcase_23 AC 4,176 ms
65,664 KB
testcase_24 AC 3 ms
5,460 KB
testcase_25 AC 93 ms
11,356 KB
testcase_26 AC 42 ms
9,948 KB
testcase_27 AC 32 ms
9,756 KB
testcase_28 AC 733 ms
22,656 KB
testcase_29 AC 372 ms
17,332 KB
testcase_30 AC 102 ms
11,356 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.Fixed
import Data.Int
import Text.Printf

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

lmin = 1e-9 :: Pico
lmax = 1e9 :: Pico
eps = 1e-10 :: Pico

main = do
 getLine
 ls <- map (fromIntegral . (read::String->Int64)) . words <$> getLine
 k <- readLn
 putStrLn $ showFixed True (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