結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー ysys
提出日時 2018-08-14 21:29:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 430 bytes
コンパイル時間 1,095 ms
コンパイル使用メモリ 81,732 KB
実行使用メモリ 94,816 KB
最終ジャッジ日時 2023-10-24 17:18:08
合計ジャッジ時間 6,137 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
94,596 KB
testcase_01 AC 113 ms
94,596 KB
testcase_02 AC 116 ms
94,596 KB
testcase_03 AC 120 ms
94,612 KB
testcase_04 AC 113 ms
94,596 KB
testcase_05 AC 114 ms
94,596 KB
testcase_06 AC 116 ms
94,600 KB
testcase_07 AC 115 ms
94,596 KB
testcase_08 AC 114 ms
94,596 KB
testcase_09 AC 112 ms
94,596 KB
testcase_10 AC 114 ms
94,596 KB
testcase_11 AC 114 ms
94,596 KB
testcase_12 AC 113 ms
94,596 KB
testcase_13 AC 116 ms
94,596 KB
testcase_14 AC 115 ms
94,596 KB
testcase_15 AC 112 ms
94,596 KB
testcase_16 AC 114 ms
94,596 KB
testcase_17 AC 114 ms
94,596 KB
testcase_18 AC 112 ms
94,596 KB
testcase_19 AC 120 ms
94,612 KB
testcase_20 WA -
testcase_21 AC 114 ms
94,596 KB
testcase_22 AC 115 ms
94,596 KB
testcase_23 AC 115 ms
94,596 KB
testcase_24 AC 114 ms
94,596 KB
testcase_25 WA -
testcase_26 AC 113 ms
94,600 KB
testcase_27 AC 115 ms
94,600 KB
testcase_28 AC 122 ms
94,596 KB
testcase_29 AC 116 ms
94,596 KB
testcase_30 AC 115 ms
94,596 KB
testcase_31 AC 116 ms
94,596 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(1000000)]
is_prime[0], is_prime[1] = False, False
for i in range(2, 1000000):
    if is_prime[i]:
        j = 2 * i
        while j < 1000000:
            is_prime[j] = False
            j += i

R = [i for i in range(1000000)]
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