結果
| 問題 |
No.1273 はじめのζ関数
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-30 22:37:19 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 487 bytes |
| コンパイル時間 | 822 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 95,616 KB |
| 最終ジャッジ日時 | 2024-07-22 02:01:57 |
| 合計ジャッジ時間 | 6,812 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 1 |
| other | TLE * 1 -- * 39 |
ソースコード
import math
import decimal
decimal.getcontext().prec=1000
def zeta(n):
if n==3:
return decimal.Decimal(0.2020569031595942853997381)
else:
ret=decimal.Decimal(0)
for i in range(2,300):
ret+=decimal.Decimal(1)/decimal.Decimal(i**n)
return ret
n=int(input())
if n>=30:
print(0)
elif n==2:
print(1000000)
else:
ans=decimal.Decimal(0)
for i in range(n,100):
ans+=zeta(i)
print(int(ans*decimal.Decimal(10**6)))