結果
| 問題 | No.144 エラトステネスのざる |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-21 20:58:07 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 259 bytes |
| 記録 | |
| コンパイル時間 | 818 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 16,000 KB |
| 最終ジャッジ日時 | 2024-10-15 00:53:27 |
| 合計ジャッジ時間 | 5,221 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 TLE * 1 -- * 6 |
ソースコード
# -*- coding: utf-8 -*-
N,p = input().split()
N = int(N)
p = float(p)
ans = 0.0
for i in range(2, N+1):
j = 2
d_num = 0
while j**2<=i:
if i%j==0:
d_num += 2 if j**2!=i else 1
j += 1
ans += (1-p)**d_num
print(ans)