Why is it all about mathematics these days ...
If you implement it according to the formula, it will pass.
k = int(input())
print(sum(1 / (n * (n + k)) for n in range(1, 10 ** 6)))
If you implement it according to the formula, it will pass.
from math import sin
k = int(input())
print(sum(sin(k * n) / (n ** n) for n in range(1, 100)))
The match ended without passing only testcase_20.
Recommended Posts