結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー ysys
提出日時 2018-08-14 21:27:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 11,956 KB
実行使用メモリ 14,776 KB
最終ジャッジ日時 2023-10-24 17:17:22
合計ジャッジ時間 5,795 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
14,736 KB
testcase_01 AC 107 ms
14,736 KB
testcase_02 AC 99 ms
14,736 KB
testcase_03 WA -
testcase_04 AC 97 ms
14,736 KB
testcase_05 AC 105 ms
14,736 KB
testcase_06 AC 102 ms
14,736 KB
testcase_07 AC 103 ms
14,736 KB
testcase_08 AC 101 ms
14,736 KB
testcase_09 AC 103 ms
14,736 KB
testcase_10 AC 101 ms
14,736 KB
testcase_11 AC 103 ms
14,736 KB
testcase_12 AC 101 ms
14,736 KB
testcase_13 AC 100 ms
14,736 KB
testcase_14 AC 107 ms
14,736 KB
testcase_15 AC 103 ms
14,736 KB
testcase_16 AC 97 ms
14,736 KB
testcase_17 AC 97 ms
14,736 KB
testcase_18 AC 100 ms
14,736 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 100 ms
14,736 KB
testcase_22 AC 98 ms
14,736 KB
testcase_23 AC 100 ms
14,736 KB
testcase_24 AC 102 ms
14,736 KB
testcase_25 WA -
testcase_26 AC 99 ms
14,736 KB
testcase_27 AC 102 ms
14,736 KB
testcase_28 AC 99 ms
14,736 KB
testcase_29 AC 100 ms
14,736 KB
testcase_30 AC 101 ms
14,736 KB
testcase_31 AC 99 ms
14,736 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, l = map(int, input().split())

is_prime = [True for i in range(100000)]
is_prime[0], is_prime[1] = False, False
for i in range(2, 100000):
    if is_prime[i]:
        j = 2 * i
        while j < 100000:
            is_prime[j] = False
            j += i

R = [i for i in range(100000)]
pr = list(filter(lambda i: is_prime[i], R))

num = 0
for i in pr:
    if (n - 1) * i <= l:
        num += l - (n - 1) * i + 1

print(num)
0