結果

問題 No.144 エラトステネスのざる
ユーザー hhhhub000hhhhub000
提出日時 2018-12-06 22:44:58
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 201 bytes
コンパイル時間 565 ms
コンパイル使用メモリ 6,668 KB
実行使用メモリ 71,884 KB
最終ジャッジ日時 2023-10-12 02:50:59
合計ジャッジ時間 4,983 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,988 KB
testcase_01 AC 11 ms
5,932 KB
testcase_02 AC 11 ms
5,828 KB
testcase_03 AC 12 ms
5,828 KB
testcase_04 AC 11 ms
5,896 KB
testcase_05 AC 12 ms
5,992 KB
testcase_06 AC 13 ms
5,928 KB
testcase_07 AC 13 ms
5,960 KB
testcase_08 AC 14 ms
5,952 KB
testcase_09 AC 13 ms
5,868 KB
testcase_10 AC 13 ms
5,864 KB
testcase_11 AC 13 ms
5,912 KB
testcase_12 AC 14 ms
5,860 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

INPUT = raw_input().split()
N,P = [int(INPUT[0]),float(INPUT[1])]
Pmap = [0,0]+[1.0] * (N-1)
for sosu in range(2,N):
   mul=2
   while sosu*mul<=N:
     Pmap[sosu*mul]*=1-P
     mul+=1
print(sum(Pmap))
0