結果

問題 No.1118 sin(x)/xの二乗和
ユーザー shotoyooshotoyoo
提出日時 2021-06-19 19:17:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 453 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 415 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 77,584 KB
最終ジャッジ日時 2023-09-05 01:10:27
合計ジャッジ時間 11,305 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 451 ms
77,372 KB
testcase_01 AC 452 ms
77,256 KB
testcase_02 AC 452 ms
77,220 KB
testcase_03 AC 451 ms
77,092 KB
testcase_04 AC 450 ms
77,144 KB
testcase_05 AC 453 ms
77,300 KB
testcase_06 AC 453 ms
77,504 KB
testcase_07 AC 452 ms
77,372 KB
testcase_08 AC 450 ms
77,284 KB
testcase_09 AC 451 ms
77,208 KB
testcase_10 AC 452 ms
77,212 KB
testcase_11 AC 453 ms
77,308 KB
testcase_12 AC 451 ms
77,268 KB
testcase_13 AC 451 ms
77,584 KB
testcase_14 AC 450 ms
77,504 KB
testcase_15 AC 451 ms
77,412 KB
testcase_16 AC 451 ms
77,092 KB
testcase_17 AC 450 ms
77,476 KB
testcase_18 AC 450 ms
77,112 KB
testcase_19 AC 451 ms
77,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()


sys.setrecursionlimit(2*10**5+10)
write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")
writef = lambda x: print("{:.12f}".format(x))

import math
def f(x):
    if x==0:
        return 1
    return math.sin(x)**2 / (x**2)
x = float(input())
ans = 0
for v in range(10**7)[::-1]:
    ans += f(x+v)
ans += 1/(x+10**7)/2
print(ans)
0