結果
| 問題 |
No.347 微分と積分
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-12-19 10:23:43 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 5,000 ms |
| コード長 | 273 bytes |
| コンパイル時間 | 407 ms |
| コンパイル使用メモリ | 82,496 KB |
| 実行使用メモリ | 54,148 KB |
| 最終ジャッジ日時 | 2024-12-19 10:23:46 |
| 合計ジャッジ時間 | 2,296 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
import math
N = int(input())
b = int(input())
A = list(map(float,input().split()))
a1 = 0
for i in range(N):
a1 += A[i]*pow(b,A[i]-1)
print(a1)
a2 = 0
for i in range(N):
if A[i]!=-1:
a2 += pow(b,A[i]+1)/(A[i]+1)
else:
a2 += math.log(b)
print(a2)