結果

問題 No.144 エラトステネスのざる
ユーザー cielciel
提出日時 2015-02-08 18:06:00
言語 PyPy2
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 189 bytes
コンパイル時間 1,323 ms
コンパイル使用メモリ 77,740 KB
実行使用メモリ 242,408 KB
最終ジャッジ日時 2023-09-05 15:34:18
合計ジャッジ時間 7,570 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
77,464 KB
testcase_01 AC 84 ms
78,016 KB
testcase_02 AC 84 ms
77,616 KB
testcase_03 AC 87 ms
77,844 KB
testcase_04 AC 88 ms
77,712 KB
testcase_05 AC 88 ms
77,672 KB
testcase_06 AC 198 ms
79,380 KB
testcase_07 AC 93 ms
79,656 KB
testcase_08 AC 92 ms
79,352 KB
testcase_09 AC 93 ms
79,272 KB
testcase_10 AC 93 ms
79,628 KB
testcase_11 AC 93 ms
79,272 KB
testcase_12 AC 93 ms
79,512 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict as D
N,P=[float(e)for e in raw_input().split()]
h=D(lambda:1)
r=0
for i in range(2,int(N)+1):
	r+=h[i]
	for j in range(i*2,int(N)+1,i):h[j]*=1-P
print(r)
0