結果
問題 | No.347 微分と積分 |
ユーザー |
![]() |
提出日時 | 2025-03-20 21:04:02 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 41 ms / 5,000 ms |
コード長 | 533 bytes |
コンパイル時間 | 283 ms |
コンパイル使用メモリ | 82,404 KB |
実行使用メモリ | 53,872 KB |
最終ジャッジ日時 | 2025-03-20 21:04:15 |
合計ジャッジ時間 | 2,039 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
import mathn = int(input())B = float(input())a_list = list(map(float, input().split()))derivative_sum = 0.0integral_sum = 0.0for a in a_list:# Calculate derivative termderivative_term = a * (B ** (a - 1))derivative_sum += derivative_term# Calculate integral termif a == -1.0:integral_term = math.log(B)else:integral_term = (B ** (a + 1)) / (a + 1)integral_sum += integral_term# Output the results with sufficient precisionprint(derivative_sum)print(integral_sum)