結果

問題 No.1539 不可欠な部分
ユーザー maguroflymagurofly
提出日時 2021-06-06 20:06:24
言語 Crystal
(1.11.2)
結果
AC  
実行時間 315 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 20,300 ms
コンパイル使用メモリ 258,200 KB
実行使用メモリ 5,272 KB
最終ジャッジ日時 2023-08-15 09:28:18
合計ジャッジ時間 45,059 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,560 KB
testcase_01 AC 260 ms
5,104 KB
testcase_02 AC 305 ms
5,248 KB
testcase_03 AC 133 ms
5,032 KB
testcase_04 AC 114 ms
5,184 KB
testcase_05 AC 90 ms
5,228 KB
testcase_06 AC 154 ms
5,192 KB
testcase_07 AC 41 ms
4,952 KB
testcase_08 AC 86 ms
5,196 KB
testcase_09 AC 259 ms
5,104 KB
testcase_10 AC 277 ms
5,228 KB
testcase_11 AC 315 ms
5,092 KB
testcase_12 AC 312 ms
5,272 KB
testcase_13 AC 306 ms
5,256 KB
testcase_14 AC 308 ms
5,216 KB
testcase_15 AC 306 ms
5,188 KB
testcase_16 AC 304 ms
5,212 KB
testcase_17 AC 298 ms
5,252 KB
testcase_18 AC 307 ms
5,204 KB
testcase_19 AC 306 ms
5,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

E = Math::E.to_f64

def f(x, n)
  E * x - E * (x**3 / n**2) / 6 + E * (x**5 / n**4) / 30 + 31 * E * (x**7 / n**6) / 5040 + 379 * E * (x**9 / n**8) / 362880
end

T = gets.to_s.to_i
a = 1 / (E * Math::PI**2)
T.times do
  n = gets.to_s.to_f64
  puts f(a, n) - f(0, n)
end
0