結果

問題 No.144 エラトステネスのざる
ユーザー pluto77pluto77
提出日時 2016-03-08 09:24:19
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 688 ms
コンパイル使用メモリ 77,560 KB
実行使用メモリ 86,752 KB
最終ジャッジ日時 2023-10-24 19:37:24
合計ジャッジ時間 3,915 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
84,896 KB
testcase_01 AC 74 ms
84,896 KB
testcase_02 AC 73 ms
84,896 KB
testcase_03 AC 73 ms
84,896 KB
testcase_04 AC 72 ms
84,896 KB
testcase_05 AC 73 ms
84,896 KB
testcase_06 AC 79 ms
85,928 KB
testcase_07 AC 80 ms
85,956 KB
testcase_08 AC 79 ms
85,956 KB
testcase_09 AC 77 ms
85,956 KB
testcase_10 AC 76 ms
85,956 KB
testcase_11 AC 76 ms
85,956 KB
testcase_12 AC 77 ms
85,956 KB
testcase_13 AC 153 ms
86,752 KB
testcase_14 AC 157 ms
86,752 KB
testcase_15 AC 155 ms
86,752 KB
testcase_16 AC 160 ms
86,752 KB
testcase_17 AC 154 ms
86,752 KB
testcase_18 AC 159 ms
86,752 KB
testcase_19 AC 153 ms
86,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding: utf-8
##yuki_144

s=raw_input().split()
N=int(s[0])
p=float(s[1])
t=[1.0 for i in xrange(10**6+1)]
res=0
for i in xrange(2,N+1):
 for j in xrange(i*2,N+1,i):
  t[j]*=(1.0-p)
 res+=t[i]

print "%.7f" % res
0