結果
| 問題 | No.144 エラトステネスのざる |
| コンテスト | |
| ユーザー |
tnodino
|
| 提出日時 | 2022-06-12 12:29:40 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 318 bytes |
| コンパイル時間 | 385 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 17,820 KB |
| 最終ジャッジ日時 | 2024-09-22 22:42:04 |
| 合計ジャッジ時間 | 4,476 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 TLE * 1 -- * 6 |
ソースコード
from math import sqrt
def divisor(N):
ret = 0
for i in range(2,int(sqrt(N))+1):
if N % i == 0:
ret += 1
if N // i != i:
ret += 1
return ret
N,p = map(float,input().split())
N = int(N)
ans = 0
for i in range(2,N+1):
ans += pow(1-p, divisor(i))
print(ans)
tnodino