結果

問題 No.144 エラトステネスのざる
ユーザー aqua_tenhouaqua_tenhou
提出日時 2020-09-16 21:29:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 260 ms / 2,000 ms
コード長 202 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 85,124 KB
最終ジャッジ日時 2023-09-04 03:58:49
合計ジャッジ時間 4,015 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,608 KB
testcase_01 AC 70 ms
71,576 KB
testcase_02 AC 71 ms
71,672 KB
testcase_03 AC 71 ms
71,516 KB
testcase_04 AC 69 ms
71,464 KB
testcase_05 AC 68 ms
71,188 KB
testcase_06 AC 75 ms
76,352 KB
testcase_07 AC 76 ms
76,740 KB
testcase_08 AC 76 ms
76,752 KB
testcase_09 AC 78 ms
77,144 KB
testcase_10 AC 77 ms
76,832 KB
testcase_11 AC 76 ms
76,648 KB
testcase_12 AC 78 ms
76,500 KB
testcase_13 AC 182 ms
84,652 KB
testcase_14 AC 223 ms
85,124 KB
testcase_15 AC 231 ms
84,988 KB
testcase_16 AC 235 ms
85,124 KB
testcase_17 AC 249 ms
85,100 KB
testcase_18 AC 260 ms
85,064 KB
testcase_19 AC 232 ms
84,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, p = map(float,input().split())
ans = 0
n = int(n)
b = [0]*(n+1)

for i in range(2,n+1):
    
    ans += pow(1-p, b[i])
    
    j = 1
    while i*j <= n:
        b[i*j] += 1
        j += 1
print(ans)
0