結果
| 問題 |
No.144 エラトステネスのざる
|
| コンテスト | |
| ユーザー |
tnodino
|
| 提出日時 | 2022-06-12 12:34:27 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 175 ms / 2,000 ms |
| コード長 | 227 bytes |
| コンパイル時間 | 245 ms |
| コンパイル使用メモリ | 82,392 KB |
| 実行使用メモリ | 83,840 KB |
| 最終ジャッジ日時 | 2024-09-22 22:45:54 |
| 合計ジャッジ時間 | 2,688 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
N,p = map(float,input().split())
N = int(N)
cnt = [0] * (N+1)
for i in range(2,N+1):
idx = i*2
while idx <= N:
cnt[idx] += 1
idx += i
ans = 0
for i in range(2,N+1):
ans += pow(1-p, cnt[i])
print(ans)
tnodino