結果

問題 No.144 エラトステネスのざる
ユーザー yuki2006yuki2006
提出日時 2015-02-06 18:29:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 129 bytes
コンパイル時間 876 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 92,924 KB
最終ジャッジ日時 2023-09-05 14:34:42
合計ジャッジ時間 4,084 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,396 KB
testcase_01 AC 81 ms
71,148 KB
testcase_02 AC 80 ms
71,452 KB
testcase_03 AC 75 ms
71,260 KB
testcase_04 AC 77 ms
71,368 KB
testcase_05 AC 77 ms
71,420 KB
testcase_06 AC 85 ms
76,536 KB
testcase_07 AC 78 ms
76,468 KB
testcase_08 AC 77 ms
76,588 KB
testcase_09 AC 80 ms
76,520 KB
testcase_10 AC 79 ms
76,396 KB
testcase_11 AC 79 ms
76,588 KB
testcase_12 AC 79 ms
76,472 KB
testcase_13 AC 174 ms
92,716 KB
testcase_14 AC 178 ms
92,900 KB
testcase_15 AC 163 ms
92,828 KB
testcase_16 AC 172 ms
92,916 KB
testcase_17 AC 169 ms
92,924 KB
testcase_18 AC 170 ms
92,772 KB
testcase_19 AC 173 ms
92,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,P=map(float,input().split())
M=int(N)+1
l=[1.0]*M
p=1-P
for i in range(2,M):
	for j in range(i+i,M,i):l[j]*=p
print(sum(l[2:]))
0