結果
| 問題 |
No.347 微分と積分
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-05 15:32:25 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 5,000 ms |
| コード長 | 574 bytes |
| コンパイル時間 | 42 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-24 14:20:57 |
| 合計ジャッジ時間 | 1,023 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
#!/usr/bin/env python
#coding:utf8
import math
def read():
raw_input()
B = input()
vList = map(float, raw_input().split())
return B, vList
def work((B, vList)):
total = 0
for i in range(len(vList)):
total += vList[i] * math.pow(B, vList[i] - 1)
print "%.10lf" % total
total = 0
for i in range(len(vList)):
if vList[i] == -1:
total += math.log(B)
else:
total += math.pow(B, vList[i] + 1) / (vList[i] + 1)
print "%.10lf" % total
if __name__ == "__main__":
work(read())