結果
| 問題 | 
                            No.347 微分と積分
                             | 
                    
| コンテスト | |
| ユーザー | 
                             ldsyb
                         | 
                    
| 提出日時 | 2016-03-03 19:30:22 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 380 bytes | 
| コンパイル時間 | 557 ms | 
| コンパイル使用メモリ | 66,604 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-24 13:52:38 | 
| 合計ジャッジ時間 | 1,217 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 2 | 
| other | AC * 18 WA * 2 | 
ソースコード
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main(){
   double f = 0,F = 0;
   int n,b;
   cin >> n >> b;
   double a[n];
   for(int i = 0;i < n;i++) cin >> a[i];
   for(int i = 0;i < n;i++){
      f += a[i] * pow(b,a[i] - 1);
      F += 1 / (a[i] + 1) * pow(b,a[i] + 1);
   }
   cout << fixed << setprecision(10) << f << endl << F << endl;
}
            
            
            
        
            
ldsyb