結果
問題 |
No.144 エラトステネスのざる
|
ユーザー |
|
提出日時 | 2019-08-04 14:31:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 259 bytes |
コンパイル時間 | 79 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 18,560 KB |
最終ジャッジ日時 | 2024-07-08 07:05:47 |
合計ジャッジ時間 | 9,715 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 TLE * 7 |
ソースコード
N, p = input().split() N, p = int(N), float(p) divisors_cnt = [0] * (N + 1) ans = 0 for i in range(1, N+1): for j in range(i, N+1, i): divisors_cnt[j] += 1 for i in range(2, N+1): c = divisors_cnt[i] ans += (1 - p) ** (c - 2) print(ans)