結果

問題 No.347 微分と積分
コンテスト
ユーザー airis
提出日時 2016-02-27 00:04:33
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 401 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 237 ms
コンパイル使用メモリ 77,764 KB
最終ジャッジ日時 2025-12-03 19:32:04
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math

EPS = 1e-9

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


def f(x):
  res = 0
  for i in xrange(len(a)):
    res += a[i] * (x**(a[i] - 1))
  return res

def F(x):
  res = 0
  for i in xrange(len(a)):
    if -1.0 - EPS <= a[i] and a[i] <= -1.0 + EPS:
      res += math.log(x)
    else:
      res += x ** (a[i] + 1) / (1.0 * (a[i] + 1))
  return res


print f(B)
print F(B)
0