結果
問題 | No.456 Millions of Submits! |
ユーザー |
![]() |
提出日時 | 2017-03-31 09:10:31 |
言語 | Haskell (9.10.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 749 bytes |
コンパイル時間 | 6,123 ms |
コンパイル使用メモリ | 170,624 KB |
実行使用メモリ | 14,016 KB |
最終ジャッジ日時 | 2024-06-23 18:32:19 |
合計ジャッジ時間 | 11,680 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 TLE * 1 |
コンパイルメッセージ
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
ソースコード
LANGUAGELANGUAGEimportControl.MonadreplicateM_importText.Printfprintfnewton::Double->Double->Double->Double->Double->Doublenewton a b t n d| abs d > 10e-10 = newton a b t n' d'| otherwise = n'wheret1 = log nt2 = n ** (a - 1.0)t3 = t1 ** (b - 1.0)d' = (t2 * n * t3 * t1 - t) / (t2 * t3 * (a * t1 + b))n' = n - d'solve::Double->Double->Double->Doublesolve a b t| a == 0.0 = exp (t ** (1.0 / b))| b == 0.0 = t ** (1.0 / a)| otherwise = newton a b t 2.0 114514main = dom <- readLnreplicateM_ m $ do[a, b, t] <- map read . words <$> getLineprintf "%.10f\n" $ solve a b t