結果
問題 | No.456 Millions of Submits! |
ユーザー | maspy |
提出日時 | 2020-03-27 10:14:25 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 547 bytes |
コンパイル時間 | 291 ms |
コンパイル使用メモリ | 10,912 KB |
実行使用メモリ | 353,216 KB |
最終ジャッジ日時 | 2023-08-30 16:14:43 |
合計ジャッジ時間 | 7,194 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 134 ms
29,668 KB |
testcase_01 | AC | 132 ms
29,724 KB |
testcase_02 | AC | 133 ms
29,712 KB |
testcase_03 | AC | 133 ms
29,720 KB |
testcase_04 | AC | 133 ms
29,700 KB |
testcase_05 | AC | 131 ms
29,768 KB |
testcase_06 | AC | 132 ms
29,728 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
ソースコード
#!/usr/bin/ python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np M = int(readline()) ABT = np.array(read().split(), np.float64) A = ABT[::3] B = ABT[1::3] T = ABT[2::3] LT = np.log(T) X = np.ones_like(T) * 0.0001 def newton(X): f = A * X + B * np.log(X) - LT df = A + B / X X -= f / df return for _ in range(10): newton(X) answer = np.exp(X) answer[B == 0] = np.exp(LT[B == 0] / A[B == 0]) print('\n'.join(answer.astype(str)))