結果
問題 | No.347 微分と積分 |
ユーザー |
|
提出日時 | 2017-07-10 14:29:10 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 453 bytes |
コンパイル時間 | 2,361 ms |
コンパイル使用メモリ | 154,956 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 20:49:18 |
合計ジャッジ時間 | 3,140 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string; import std.math; // math functions // allowable-error: 10 ** -4 void main() { auto n = readln.chomp.to!size_t; auto b = readln.chomp.to!real; auto a = readln.split.to!(real[]); auto rd = real(0), ri = real(0); foreach (ai; a) { rd += ai * b ^^ (ai - 1); ri += ai == -1 ? log(b) : b ^^ (ai + 1) / (ai + 1); } writefln("%.5f", rd); writefln("%.5f", ri); }