結果
| 問題 | 
                            No.347 微分と積分
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-03-17 21:41:07 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 40 ms / 5,000 ms | 
| コード長 | 258 bytes | 
| コンパイル時間 | 366 ms | 
| コンパイル使用メモリ | 82,388 KB | 
| 実行使用メモリ | 53,936 KB | 
| 最終ジャッジ日時 | 2024-10-01 20:40:00 | 
| 合計ジャッジ時間 | 2,265 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 20 | 
ソースコード
N = int(input())
B = int(input())
a = list(map(float,input().split()))
ans1 = 0
ans2 = 0
from math import log
for i in a:
    ans1 += i * pow(B,i-1)
    if i != -1:
        ans2 += pow(B,i+1) / (i+1)
    else:
        ans2 += log(B)
print(ans1)
print(ans2)