結果
| 問題 | No.144 エラトステネスのざる |
| コンテスト | |
| ユーザー |
takakin
|
| 提出日時 | 2020-05-06 22:20:53 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 302 bytes |
| 記録 | |
| コンパイル時間 | 137 ms |
| コンパイル使用メモリ | 82,032 KB |
| 実行使用メモリ | 83,092 KB |
| 最終ジャッジ日時 | 2024-07-03 09:10:57 |
| 合計ジャッジ時間 | 4,377 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 TLE * 1 -- * 6 |
ソースコード
import sys
input=lambda: sys.stdin.readline().rstrip()
n,p=map(float,input().split())
n=int(n)
def f(n):
D=[]
for i in range(1,int(n**0.5)+1):
if n%i==0:
D.append(i)
if i!=n//i:
D.append(n//i)
return len(D)
ans=0
for i in range(2,n+1):
ans+=pow(1-p,f(i)-2)
print(ans)
takakin