結果

問題 No.144 エラトステネスのざる
ユーザー tnoda_tnoda_
提出日時 2015-08-13 15:44:20
言語 Python2
(2.7.18)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 216 bytes
コンパイル時間 46 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 21,560 KB
最終ジャッジ日時 2023-09-05 14:30:56
合計ジャッジ時間 15,984 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,004 KB
testcase_01 AC 12 ms
5,876 KB
testcase_02 AC 12 ms
6,228 KB
testcase_03 AC 12 ms
5,960 KB
testcase_04 AC 11 ms
5,932 KB
testcase_05 AC 11 ms
6,040 KB
testcase_06 AC 12 ms
6,016 KB
testcase_07 AC 12 ms
6,340 KB
testcase_08 AC 12 ms
6,272 KB
testcase_09 AC 12 ms
6,228 KB
testcase_10 AC 13 ms
6,308 KB
testcase_11 AC 12 ms
6,288 KB
testcase_12 AC 13 ms
6,024 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, p = raw_input().strip().split()
N = int(N)
p = 1.0 - float(p)
dp = [0] * (N+1)
for i in xrange(2, N+1):
    for j in xrange(2*i, N+1, i):
        dp[j] += 1
ans = sum(pow(p, x) for x in dp[2:])
print('%.7f' % ans)
0