結果

問題 No.2645 Sum of Divisors?
ユーザー shobonvipshobonvip
提出日時 2024-02-19 06:34:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 361 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 49,240 KB
最終ジャッジ日時 2024-02-19 06:35:21
合計ジャッジ時間 27,506 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 282 ms
49,240 KB
testcase_01 AC 306 ms
49,240 KB
testcase_02 AC 1,417 ms
49,240 KB
testcase_03 AC 272 ms
49,240 KB
testcase_04 AC 302 ms
49,240 KB
testcase_05 AC 281 ms
49,240 KB
testcase_06 TLE -
testcase_07 TLE -
testcase_08 AC 311 ms
49,240 KB
testcase_09 AC 285 ms
49,240 KB
testcase_10 AC 277 ms
49,240 KB
testcase_11 AC 284 ms
49,240 KB
testcase_12 AC 309 ms
49,240 KB
testcase_13 AC 280 ms
49,240 KB
testcase_14 AC 285 ms
49,240 KB
testcase_15 AC 277 ms
49,240 KB
testcase_16 AC 302 ms
49,240 KB
testcase_17 AC 293 ms
49,240 KB
testcase_18 AC 301 ms
49,240 KB
testcase_19 AC 281 ms
49,240 KB
testcase_20 AC 285 ms
49,240 KB
testcase_21 AC 307 ms
49,240 KB
testcase_22 AC 310 ms
49,240 KB
testcase_23 AC 325 ms
49,240 KB
testcase_24 AC 444 ms
49,240 KB
testcase_25 AC 410 ms
49,240 KB
testcase_26 AC 510 ms
49,240 KB
testcase_27 AC 577 ms
49,240 KB
testcase_28 AC 917 ms
49,240 KB
testcase_29 TLE -
testcase_30 AC 1,058 ms
49,240 KB
testcase_31 AC 1,534 ms
49,240 KB
testcase_32 AC 1,894 ms
49,240 KB
testcase_33 AC 1,018 ms
49,240 KB
testcase_34 AC 1,702 ms
49,240 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