結果
問題 | No.1042 愚直大学 |
ユーザー |
|
提出日時 | 2020-05-01 22:11:33 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 344 bytes |
コンパイル時間 | 10,622 ms |
コンパイル使用メモリ | 173,184 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-25 11:39:39 |
合計ジャッジ時間 | 11,461 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
コンパイルメッセージ
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
ソースコード
importText.Printfbis ok ng f| del < 1e-6 || del / ok < 1e-6 = ok| f m = bis m ng f| otherwise = bis ok m fwheredel = abs $ ok - ngm = (ok + ng) / 2solve p q = bis 1 3.6e10 f wheref n = n^2 <= p + q * n * logBase 2 nmain = do[p, q] <- map read . words <$> getLine :: IO [Double]printf "%.9f\n" $ solve p q