結果

問題 No.347 微分と積分
ユーザー rpy3cpp
提出日時 2016-02-26 23:16:21
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 345 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-22 23:07:06
合計ジャッジ時間 1,620 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = int(input())
B = int(input())
As = list(map(float, input().split()))

def solve(N, B, As):
    x1 = 0
    x2 = 0
    for a in As:
        x1 += a * B ** (a-1)
        if a != -1:
            x2 += (B ** (a + 1))/(a + 1)
        else:
            x2 += math.log(B)
    return x1, x2

x1, x2 = solve(N, B, As)
print(x1)
print(x2)
0