結果
問題 |
No.456 Millions of Submits!
|
ユーザー |
![]() |
提出日時 | 2025-04-16 00:55:39 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,400 ms / 4,500 ms |
コード長 | 909 bytes |
コンパイル時間 | 402 ms |
コンパイル使用メモリ | 82,028 KB |
実行使用メモリ | 285,460 KB |
最終ジャッジ日時 | 2025-04-16 00:57:29 |
合計ジャッジ時間 | 7,531 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
import sys import math def main(): input = sys.stdin.read().split() m = int(input[0]) idx = 1 for _ in range(m): a = int(input[idx]) b = int(input[idx+1]) t = float(input[idx+2]) idx += 3 if a == 0: exponent = t ** (1.0 / b) n = math.exp(exponent) elif b == 0: n = t ** (1.0 / a) else: C = math.log(t) y = 1.0 for _ in range(50): if y <= 0: y = 1e-12 f = a * y + b * math.log(y) - C df = a + b / y if abs(f) < 1e-13: break delta = f / df y -= delta if y < 1e-12: y = 1e-12 n = math.exp(y) print("{0:.12f}".format(n)) if __name__ == "__main__": main()