結果

問題 No.347 微分と積分
ユーザー shoooooshooooo
提出日時 2019-11-30 12:56:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 293 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 29,692 KB
最終ジャッジ日時 2023-08-13 08:15:36
合計ジャッジ時間 6,966 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
29,588 KB
testcase_01 AC 131 ms
29,496 KB
testcase_02 AC 131 ms
29,504 KB
testcase_03 AC 133 ms
29,692 KB
testcase_04 AC 131 ms
29,620 KB
testcase_05 AC 132 ms
29,516 KB
testcase_06 AC 131 ms
29,536 KB
testcase_07 AC 129 ms
29,628 KB
testcase_08 AC 128 ms
29,604 KB
testcase_09 AC 129 ms
29,688 KB
testcase_10 AC 130 ms
29,684 KB
testcase_11 AC 133 ms
29,636 KB
testcase_12 AC 133 ms
29,652 KB
testcase_13 AC 132 ms
29,688 KB
testcase_14 AC 131 ms
29,684 KB
testcase_15 AC 131 ms
29,664 KB
testcase_16 AC 135 ms
29,604 KB
testcase_17 AC 130 ms
29,520 KB
testcase_18 AC 130 ms
29,672 KB
testcase_19 AC 130 ms
29,672 KB
testcase_20 AC 130 ms
29,584 KB
testcase_21 AC 132 ms
29,536 KB
testcase_22 AC 134 ms
29,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
N=int(input())
B=int(input())
a=list(map(float,input().split()))
diff=0
integral=0
for i in range(N):
  diff+=(a[i]*B**(a[i]-1))
  if a[i]==0:
    integral+=B
  elif a[i]==-1:
    integral+=(np.log(B))
  else:
    integral+=(B**(a[i]+1)/(a[i]+1))
print(diff)
print(integral)
0