結果

問題 No.2971 無理積分
コンテスト
ユーザー anonymously
提出日時 2024-11-29 22:07:14
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 458 ms / 1,000 ms
+ 121µs
コード長 210 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 60 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2026-10-02 05:26:24
合計ジャッジ時間 18,797 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from math import sqrt

N = int(input())


def func(x):
    return sqrt(x*x*x+N*N*N)


S = 0
n = 1 << 20
for i in range(n+1):
    S += (1 if i == 0 or i == n else 4 if i % 2 else 2) * func(i/n)
print(S / (3*n))
0