結果

問題 No.144 エラトステネスのざる
ユーザー buey_tbuey_t
提出日時 2022-12-12 00:20:44
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 247 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 67,200 KB
最終ジャッジ日時 2024-04-23 18:36:19
合計ジャッジ時間 4,643 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
57,344 KB
testcase_01 AC 36 ms
51,840 KB
testcase_02 AC 41 ms
52,224 KB
testcase_03 AC 38 ms
52,224 KB
testcase_04 AC 41 ms
51,968 KB
testcase_05 AC 41 ms
51,584 KB
testcase_06 AC 57 ms
60,416 KB
testcase_07 AC 61 ms
60,928 KB
testcase_08 AC 60 ms
60,544 KB
testcase_09 AC 58 ms
60,672 KB
testcase_10 AC 60 ms
60,800 KB
testcase_11 AC 57 ms
60,544 KB
testcase_12 AC 58 ms
60,800 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, p = map(float, input().split())
N = int(N)

#2は扱いにくいから先に足しておく
ans = 1

for i in range(3, N+1):
    count = 0
    for j in range(2, i):
        if i%j == 0:
            count += 1
    ans += (1-p)**count

print(ans)
0