結果
問題 |
No.347 微分と積分
|
ユーザー |
|
提出日時 | 2016-02-26 23:50:50 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 472 bytes |
コンパイル時間 | 1,232 ms |
コンパイル使用メモリ | 158,360 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-23 03:14:20 |
合計ジャッジ時間 | 1,984 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> #define REP(i,a,b) for(i=a;i<b;i++) #define rep(i,n) REP(i,0,n) using namespace std; int main() { int i,j; cin.tie(0); ios::sync_with_stdio(false); int N; int B; double c = 0; double d = 0; cin >> N; cin >> B; rep(i,N) { double a; cin >> a; c += a*pow(B,a-1); if(a == -1) { d += log((double)B); } else d += 1/(a+1)*( pow(B,a+1) ); } printf("%.20lf\n",c); printf("%.20lf\n",d); return 0; }