結果

問題 No.347 微分と積分
ユーザー HachimoriHachimori
提出日時 2016-03-05 15:32:25
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 5,000 ms
コード長 574 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 7,128 KB
実行使用メモリ 6,772 KB
最終ジャッジ日時 2023-10-24 19:54:30
合計ジャッジ時間 1,246 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#!/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())
0