結果

問題 No.347 微分と積分
ユーザー shoooooshooooo
提出日時 2019-11-30 12:56:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 470 ms / 5,000 ms
コード長 293 bytes
コンパイル時間 481 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 44,580 KB
最終ジャッジ日時 2024-05-01 01:56:10
合計ジャッジ時間 12,114 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 443 ms
44,564 KB
testcase_01 AC 445 ms
44,188 KB
testcase_02 AC 443 ms
44,192 KB
testcase_03 AC 443 ms
44,196 KB
testcase_04 AC 441 ms
44,320 KB
testcase_05 AC 470 ms
44,192 KB
testcase_06 AC 450 ms
44,320 KB
testcase_07 AC 446 ms
44,064 KB
testcase_08 AC 450 ms
44,068 KB
testcase_09 AC 445 ms
44,580 KB
testcase_10 AC 442 ms
44,432 KB
testcase_11 AC 440 ms
44,188 KB
testcase_12 AC 446 ms
44,576 KB
testcase_13 AC 464 ms
44,320 KB
testcase_14 AC 455 ms
44,056 KB
testcase_15 AC 447 ms
44,328 KB
testcase_16 AC 439 ms
44,060 KB
testcase_17 AC 440 ms
44,332 KB
testcase_18 AC 441 ms
44,188 KB
testcase_19 AC 453 ms
44,316 KB
testcase_20 AC 436 ms
44,580 KB
testcase_21 AC 447 ms
43,932 KB
testcase_22 AC 437 ms
44,184 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