結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー H3PO4H3PO4
提出日時 2020-07-23 09:27:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 476 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 47,260 KB
最終ジャッジ日時 2023-09-05 22:03:02
合計ジャッジ時間 5,522 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,924 KB
testcase_01 AC 16 ms
7,780 KB
testcase_02 AC 15 ms
7,864 KB
testcase_03 AC 36 ms
9,128 KB
testcase_04 AC 16 ms
7,872 KB
testcase_05 AC 16 ms
7,876 KB
testcase_06 AC 15 ms
7,872 KB
testcase_07 AC 16 ms
7,816 KB
testcase_08 AC 16 ms
7,872 KB
testcase_09 AC 16 ms
7,808 KB
testcase_10 AC 16 ms
7,776 KB
testcase_11 AC 16 ms
7,864 KB
testcase_12 AC 16 ms
7,872 KB
testcase_13 AC 16 ms
7,776 KB
testcase_14 AC 16 ms
7,796 KB
testcase_15 AC 16 ms
7,844 KB
testcase_16 AC 16 ms
7,732 KB
testcase_17 AC 16 ms
7,872 KB
testcase_18 AC 16 ms
7,784 KB
testcase_19 AC 89 ms
11,984 KB
testcase_20 AC 285 ms
19,752 KB
testcase_21 AC 15 ms
7,872 KB
testcase_22 AC 16 ms
7,780 KB
testcase_23 AC 15 ms
7,888 KB
testcase_24 AC 15 ms
7,860 KB
testcase_25 AC 503 ms
27,616 KB
testcase_26 AC 16 ms
7,924 KB
testcase_27 AC 16 ms
7,812 KB
testcase_28 AC 15 ms
7,728 KB
testcase_29 AC 16 ms
7,920 KB
testcase_30 AC 16 ms
7,796 KB
testcase_31 AC 16 ms
7,812 KB
testcase_32 AC 229 ms
17,592 KB
testcase_33 AC 996 ms
47,260 KB
testcase_34 TLE -
testcase_35 AC 445 ms
25,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n ** 0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return (i for i in range(n + 1) if is_prime[i])


N, L = map(int, input().split())
ans = 0
for d in primes(L // (N - 1) + 1):
    if (length := (N - 1) * d) > L:
        break
    ans += L - length + 1
print(ans)
0