結果

問題 No.144 エラトステネスのざる
ユーザー あかりきあかりき
提出日時 2021-02-23 21:26:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 193 ms / 2,000 ms
コード長 182 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 81,588 KB
実行使用メモリ 83,540 KB
最終ジャッジ日時 2023-10-23 22:22:39
合計ジャッジ時間 3,090 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,536 KB
testcase_01 AC 36 ms
53,412 KB
testcase_02 AC 37 ms
53,644 KB
testcase_03 AC 38 ms
53,412 KB
testcase_04 AC 38 ms
53,412 KB
testcase_05 AC 39 ms
53,412 KB
testcase_06 AC 43 ms
59,928 KB
testcase_07 AC 42 ms
60,164 KB
testcase_08 AC 44 ms
60,164 KB
testcase_09 AC 42 ms
60,164 KB
testcase_10 AC 42 ms
60,164 KB
testcase_11 AC 42 ms
60,164 KB
testcase_12 AC 42 ms
60,060 KB
testcase_13 AC 159 ms
83,220 KB
testcase_14 AC 187 ms
83,452 KB
testcase_15 AC 186 ms
83,452 KB
testcase_16 AC 187 ms
83,452 KB
testcase_17 AC 187 ms
83,452 KB
testcase_18 AC 193 ms
83,540 KB
testcase_19 AC 178 ms
83,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,p=map(float,input().split())
n=int(n)
ct=[0]*(n+1)
for i in range(1,n+1):
  for j in range(n//i):
    ct[i*(j+1)]+=1
ans=0
for i in range(2,n+1):
  ans+=(1-p)**(ct[i]-2)
print(ans)
0