結果

問題 No.347 微分と積分
ユーザー roiti46roiti46
提出日時 2016-02-26 22:39:23
言語 Python2
(2.7.18)
結果
AC  
実行時間 24 ms / 5,000 ms
コード長 352 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 7,124 KB
実行使用メモリ 8,536 KB
最終ジャッジ日時 2023-10-24 05:09:55
合計ジャッジ時間 2,232 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
8,536 KB
testcase_01 AC 23 ms
8,536 KB
testcase_02 AC 22 ms
8,536 KB
testcase_03 AC 22 ms
8,536 KB
testcase_04 AC 22 ms
8,360 KB
testcase_05 AC 22 ms
8,360 KB
testcase_06 AC 22 ms
8,536 KB
testcase_07 AC 22 ms
8,536 KB
testcase_08 AC 22 ms
8,536 KB
testcase_09 AC 23 ms
8,536 KB
testcase_10 AC 22 ms
8,536 KB
testcase_11 AC 24 ms
8,536 KB
testcase_12 AC 23 ms
8,360 KB
testcase_13 AC 24 ms
8,536 KB
testcase_14 AC 23 ms
8,536 KB
testcase_15 AC 23 ms
8,536 KB
testcase_16 AC 23 ms
8,536 KB
testcase_17 AC 23 ms
8,536 KB
testcase_18 AC 23 ms
8,536 KB
testcase_19 AC 23 ms
8,360 KB
testcase_20 AC 22 ms
8,536 KB
testcase_21 AC 23 ms
8,536 KB
testcase_22 AC 23 ms
8,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

N = int(raw_input())
B = int(raw_input())
a = map(float, raw_input().split())

f_div_B = sum(ai*B**(ai - 1) for ai in a)
F_B = sum(1.0/(ai + 1)*B**(ai + 1) if ai != -1.0 else math.log(B) for ai in a)
print "%.10f" % f_div_B
print "%.10f" % F_B
0