結果

問題 No.144 エラトステネスのざる
ユーザー pekempeypekempey
提出日時 2015-10-06 11:44:08
言語 Python2
(2.7.18)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 249 bytes
コンパイル時間 542 ms
コンパイル使用メモリ 6,500 KB
実行使用メモリ 16,288 KB
最終ジャッジ日時 2023-09-27 07:33:31
合計ジャッジ時間 17,116 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
8,728 KB
testcase_01 AC 13 ms
8,840 KB
testcase_02 AC 13 ms
8,656 KB
testcase_03 AC 12 ms
8,680 KB
testcase_04 AC 13 ms
8,652 KB
testcase_05 AC 12 ms
8,804 KB
testcase_06 AC 14 ms
8,748 KB
testcase_07 AC 14 ms
8,712 KB
testcase_08 AC 16 ms
8,656 KB
testcase_09 AC 14 ms
8,612 KB
testcase_10 AC 14 ms
8,768 KB
testcase_11 AC 15 ms
8,676 KB
testcase_12 AC 14 ms
8,676 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import random, sys

strs = raw_input().split()
N = int(strs[0])
p = float(strs[1])

d = [0] * (N + 1)

for i in xrange(1, N + 1):
	for j in xrange(i, N + 1, i):
		d[j] += 1

ans = 0.0
for i in xrange(2, N + 1):
	ans += pow(1 - p, d[i] - 2)
print ans
0