結果

問題 No.2645 Sum of Divisors?
ユーザー shobonvipshobonvip
提出日時 2024-02-19 06:35:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 202 ms / 2,000 ms
コード長 361 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 91,364 KB
最終ジャッジ日時 2024-02-19 06:35:17
合計ジャッジ時間 4,457 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
75,680 KB
testcase_01 AC 57 ms
78,144 KB
testcase_02 AC 126 ms
91,364 KB
testcase_03 AC 55 ms
75,680 KB
testcase_04 AC 52 ms
75,680 KB
testcase_05 AC 52 ms
75,680 KB
testcase_06 AC 176 ms
91,360 KB
testcase_07 AC 202 ms
91,360 KB
testcase_08 AC 53 ms
75,680 KB
testcase_09 AC 52 ms
75,680 KB
testcase_10 AC 52 ms
75,676 KB
testcase_11 AC 52 ms
75,680 KB
testcase_12 AC 52 ms
75,680 KB
testcase_13 AC 53 ms
75,680 KB
testcase_14 AC 54 ms
75,808 KB
testcase_15 AC 53 ms
75,672 KB
testcase_16 AC 57 ms
78,144 KB
testcase_17 AC 57 ms
78,144 KB
testcase_18 AC 56 ms
78,144 KB
testcase_19 AC 56 ms
78,144 KB
testcase_20 AC 58 ms
78,140 KB
testcase_21 AC 59 ms
78,144 KB
testcase_22 AC 58 ms
78,140 KB
testcase_23 AC 65 ms
80,344 KB
testcase_24 AC 72 ms
82,404 KB
testcase_25 AC 70 ms
82,404 KB
testcase_26 AC 76 ms
84,452 KB
testcase_27 AC 84 ms
84,452 KB
testcase_28 AC 107 ms
91,364 KB
testcase_29 AC 200 ms
91,360 KB
testcase_30 AC 109 ms
91,364 KB
testcase_31 AC 128 ms
91,364 KB
testcase_32 AC 152 ms
91,360 KB
testcase_33 AC 109 ms
91,364 KB
testcase_34 AC 145 ms
91,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
mx = 1000000

logmx = math.log(mx)
H_table = [0] * (mx+1)

def H(n):
	if n < 0: return 0.0
	if n <= mx: return H_table[n]
	return H_table[mx] + math.log(n) - logmx

for i in range(1, mx+1):
	H_table[i] = H_table[i-1] + 1 / i

n = int(input())
ans = 0.0
i = n
while i > 0:
	v = n // i
	j = n // (v + 1)
	ans += H(v) * (H(i) - H(j))
	i = j

print(ans)
0