結果
| 問題 | No.454 逆2乗和 |
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2017-01-02 13:41:30 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 463 bytes |
| 記録 | |
| コンパイル時間 | 2,408 ms |
| コンパイル使用メモリ | 122,924 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2026-03-05 11:30:08 |
| 合計ジャッジ時間 | 2,912 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 |
ソースコード
import std.conv;
import std.mathspecial;
import std.stdio;
import std.string;
const real H = 1e-6;
template sevenPointDiff(alias f){
T sevenPointDiff(T)(T x, T h=H){
T res;
res = f(x + 3 * h) / 60 - 3 * f(x + 2 * h) / 20;
res += 3 * f(x + h) / 4 - 3 * f (x - h) / 4;
res += 3 * f(x - 2 * h) / 20 - f(x - 3 * h) / 60;
res /= h;
return res;
}
}
void main(){
auto x = readln.chomp.to!real;
writefln("%.12f", sevenPointDiff!(digamma)(x + 1));
}
はむ吉🐹