結果
| 問題 | No.144 エラトステネスのざる |
| コンテスト | |
| ユーザー |
tnodino
|
| 提出日時 | 2022-06-12 12:34:07 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 227 bytes |
| 記録 | |
| コンパイル時間 | 346 ms |
| コンパイル使用メモリ | 20,952 KB |
| 実行使用メモリ | 23,332 KB |
| 最終ジャッジ日時 | 2026-04-11 05:00:21 |
| 合計ジャッジ時間 | 19,067 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 TLE * 7 |
ソースコード
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