結果

問題 No.144 エラトステネスのざる
ユーザー hhhhub000hhhhub000
提出日時 2018-12-06 22:59:09
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 204 ms / 2,000 ms
コード長 201 bytes
コンパイル時間 1,405 ms
コンパイル使用メモリ 77,448 KB
実行使用メモリ 103,260 KB
最終ジャッジ日時 2023-10-12 02:51:18
合計ジャッジ時間 4,911 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
76,532 KB
testcase_01 AC 75 ms
76,216 KB
testcase_02 AC 73 ms
76,448 KB
testcase_03 AC 74 ms
76,452 KB
testcase_04 AC 76 ms
76,296 KB
testcase_05 AC 75 ms
76,640 KB
testcase_06 AC 88 ms
79,104 KB
testcase_07 AC 83 ms
79,396 KB
testcase_08 AC 81 ms
79,024 KB
testcase_09 AC 84 ms
78,936 KB
testcase_10 AC 83 ms
79,104 KB
testcase_11 AC 82 ms
79,076 KB
testcase_12 AC 82 ms
79,092 KB
testcase_13 AC 184 ms
103,260 KB
testcase_14 AC 204 ms
102,724 KB
testcase_15 AC 199 ms
102,476 KB
testcase_16 AC 190 ms
102,368 KB
testcase_17 AC 186 ms
102,156 KB
testcase_18 AC 196 ms
101,968 KB
testcase_19 AC 204 ms
102,064 KB
権限があれば一括ダウンロードができます

ソースコード

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