結果
| 問題 | No.347 微分と積分 |
| コンテスト | |
| ユーザー |
startcpp
|
| 提出日時 | 2016-02-28 01:03:55 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 469µs | |
| コード長 | 463 bytes |
| 記録 | |
| コンパイル時間 | 317 ms |
| コンパイル使用メモリ | 77,120 KB |
| 実行使用メモリ | 9,876 KB |
| 最終ジャッジ日時 | 2026-09-03 05:54:45 |
| 合計ジャッジ時間 | 1,831 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int n;
int b;
double a[10];
int main(){
int i;
cin >> n >> b;
for( i = 0; i < n; i++ )
cin >> a[i];
double f = 0;
double F = 0;
for( i = 0; i < n; i++ ){
f += a[i] * pow((double)b, a[i] - 1.0);
if( fabs(a[i] + 1.0) > 1e-6 )
F += 1 / (a[i] + 1) * pow((double)b, a[i] + 1.0);
else
F += log((double)b);
}
printf("%.14f\n", f);
printf("%.14f\n", F);
return 0;
}
startcpp