結果
問題 |
No.352 カード並べ
|
ユーザー |
|
提出日時 | 2017-07-11 12:07:01 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 343 bytes |
コンパイル時間 | 2,543 ms |
コンパイル使用メモリ | 148,668 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 20:50:45 |
合計ジャッジ時間 | 3,184 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string; // allowable-error: 10 ** -6 void main() { auto n = readln.chomp.to!int; auto r = real(1); foreach (i; 1..n) { auto s = i; foreach (a; 1..i+1) foreach (b; a+1..i+1) s += a * b; r += s.to!real * 2 / (i + 1) / i; } writefln("%.7f", r); }