結果
| 問題 | No.144 エラトステネスのざる |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-29 15:17:16 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 225 bytes |
| コンパイル時間 | 119 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-09-13 01:59:44 |
| 合計ジャッジ時間 | 1,484 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 17 |
ソースコード
N,p = int(input()), float(input())
A0 = list(range(2,N+1))
def E(A):
if len(A)==0:
return 0
a = A[0]
A_s = [i for i in A if i%a != 0]
A_f = A[1:]
return p*(E(A_s)+1)+(1-p)*(E(A_f)+1)
print(E(A0))