結果
| 問題 |
No.1278 どんな級数?
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 13:59:09 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 494 bytes |
| コンパイル時間 | 377 ms |
| コンパイル使用メモリ | 82,280 KB |
| 実行使用メモリ | 75,732 KB |
| 最終ジャッジ日時 | 2025-06-12 13:59:22 |
| 合計ジャッジ時間 | 4,472 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 WA * 41 RE * 11 |
ソースコード
import math
X, K = map(int, input().split())
if X == 1:
ans = 1.0 - 1.0 / (2 ** (K + 1))
print("{0:.9f}".format(ans))
elif X == 2:
if K == 1:
print(0.5)
else:
if K >= 40:
print(0.0)
else:
res = 0.0
n = 2
while True:
term = 1.0 / (n ** K)
if term < 1e-13:
break
res += term
n += 1
print("{0:.9f}".format(res))
gew1fw