結果

問題 No.1271 初めての級数
ユーザー kozykozy
提出日時 2020-10-30 21:39:17
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 127 bytes
コンパイル時間 62 ms
使用メモリ 9,776 KB
最終ジャッジ日時 2023-02-21 11:34:06
合計ジャッジ時間 1,261 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 16 ms
7,740 KB
testcase_01 AC 16 ms
9,768 KB
testcase_02 AC 16 ms
9,732 KB
testcase_03 AC 16 ms
9,704 KB
testcase_04 AC 16 ms
9,776 KB
testcase_05 AC 16 ms
7,836 KB
testcase_06 AC 16 ms
9,692 KB
testcase_07 AC 16 ms
9,748 KB
testcase_08 AC 16 ms
9,768 KB
testcase_09 AC 16 ms
7,732 KB
testcase_10 AC 16 ms
7,764 KB
testcase_11 AC 16 ms
9,700 KB
testcase_12 AC 16 ms
7,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
pi=math.pi
k=int(input())
if k==0:
  print(pi*pi/6)
  exit()
ans=0
for i in range(1,k+1):
    ans+=1/i
print(ans/k)
0