結果

問題 No.1271 初めての級数
ユーザー morningsugarmorningsugar
提出日時 2021-08-30 14:32:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 126 bytes
コンパイル時間 937 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 7,912 KB
最終ジャッジ日時 2023-08-15 12:23:28
合計ジャッジ時間 1,245 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 12 ms
7,868 KB
testcase_02 AC 13 ms
7,912 KB
testcase_03 AC 13 ms
7,832 KB
testcase_04 AC 13 ms
7,808 KB
testcase_05 AC 12 ms
7,820 KB
testcase_06 AC 12 ms
7,772 KB
testcase_07 AC 13 ms
7,852 KB
testcase_08 AC 12 ms
7,872 KB
testcase_09 AC 12 ms
7,900 KB
testcase_10 AC 13 ms
7,824 KB
testcase_11 AC 13 ms
7,768 KB
testcase_12 AC 13 ms
7,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

k = int(input())
try:
    l = 1/k
except ZeroDivisionError:
    l = 0

x = 0
for i in range(1,k+1):
    x = x + 1/i
print(l*x)
0