結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー htkbhtkb
提出日時 2018-05-27 13:04:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 309 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 217,656 KB
最終ジャッジ日時 2023-09-11 03:54:40
合計ジャッジ時間 8,072 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,928 KB
testcase_01 AC 17 ms
7,916 KB
testcase_02 AC 17 ms
7,940 KB
testcase_03 AC 68 ms
20,536 KB
testcase_04 AC 16 ms
7,892 KB
testcase_05 AC 17 ms
8,028 KB
testcase_06 AC 16 ms
8,080 KB
testcase_07 AC 17 ms
7,880 KB
testcase_08 AC 17 ms
7,944 KB
testcase_09 AC 17 ms
8,012 KB
testcase_10 AC 16 ms
7,960 KB
testcase_11 AC 18 ms
7,908 KB
testcase_12 AC 16 ms
8,028 KB
testcase_13 AC 17 ms
7,912 KB
testcase_14 AC 16 ms
8,368 KB
testcase_15 AC 16 ms
7,932 KB
testcase_16 AC 16 ms
7,900 KB
testcase_17 AC 16 ms
7,948 KB
testcase_18 AC 17 ms
7,892 KB
testcase_19 AC 282 ms
48,252 KB
testcase_20 TLE -
testcase_21 AC 17 ms
7,900 KB
testcase_22 AC 16 ms
7,876 KB
testcase_23 AC 16 ms
7,916 KB
testcase_24 AC 16 ms
7,892 KB
testcase_25 TLE -
testcase_26 AC 16 ms
7,960 KB
testcase_27 AC 16 ms
7,932 KB
testcase_28 AC 16 ms
7,852 KB
testcase_29 AC 16 ms
7,892 KB
testcase_30 AC 16 ms
7,848 KB
testcase_31 AC 16 ms
8,056 KB
testcase_32 AC 737 ms
112,220 KB
testcase_33 TLE -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt
N, L = map(int, input().split())
result = 0
max_interval = int(L//(N-1))

primes = set(range(2, max_interval+1))
for i in range(2, int(sqrt(max_interval))+1):
    primes.difference_update(range(i*2, max_interval+1, i))

for x in primes:
    d = x*(N-1)
    result += L-d+1

print(result)
0