結果
問題 | No.347 微分と積分 |
ユーザー |
|
提出日時 | 2016-02-27 00:04:57 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 463 bytes |
コンパイル時間 | 507 ms |
コンパイル使用メモリ | 65,076 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 10:38:53 |
合計ジャッジ時間 | 1,285 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <iostream>#include <cstdio>#include <cmath>#include <vector>#include <algorithm>using namespace std;int main(){int n;int i;double a,b,integ=0.0,div=0.0;cin >> n >> b;for (i=0;i<n;i++){cin>>a;if (a!=1.0) div+=(a)*pow(b,a-1.0);else div+=1.0;if (a!=-1.0) integ+=pow(b,a+1.0)/(a+1.0);else integ+=log(abs(b));}printf("%f\n%f\n",div,integ);return 0;}