結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー convexineqconvexineq
提出日時 2021-02-10 00:17:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 307 ms / 1,000 ms
コード長 406 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 87,288 KB
実行使用メモリ 171,184 KB
最終ジャッジ日時 2023-09-21 11:46:18
合計ジャッジ時間 7,350 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,704 KB
testcase_01 AC 68 ms
71,952 KB
testcase_02 AC 69 ms
71,968 KB
testcase_03 AC 95 ms
84,160 KB
testcase_04 AC 69 ms
71,896 KB
testcase_05 AC 299 ms
165,260 KB
testcase_06 AC 192 ms
124,860 KB
testcase_07 AC 69 ms
71,896 KB
testcase_08 AC 67 ms
71,712 KB
testcase_09 AC 68 ms
71,756 KB
testcase_10 AC 69 ms
71,872 KB
testcase_11 AC 70 ms
71,860 KB
testcase_12 AC 76 ms
76,784 KB
testcase_13 AC 74 ms
75,920 KB
testcase_14 AC 75 ms
76,664 KB
testcase_15 AC 68 ms
71,760 KB
testcase_16 AC 69 ms
71,896 KB
testcase_17 AC 67 ms
71,756 KB
testcase_18 AC 68 ms
71,804 KB
testcase_19 AC 93 ms
84,512 KB
testcase_20 AC 132 ms
102,912 KB
testcase_21 AC 101 ms
87,200 KB
testcase_22 AC 95 ms
84,916 KB
testcase_23 AC 113 ms
93,064 KB
testcase_24 AC 132 ms
103,020 KB
testcase_25 AC 182 ms
121,800 KB
testcase_26 AC 178 ms
121,572 KB
testcase_27 AC 88 ms
81,676 KB
testcase_28 AC 120 ms
95,216 KB
testcase_29 AC 177 ms
120,572 KB
testcase_30 AC 92 ms
83,236 KB
testcase_31 AC 161 ms
112,648 KB
testcase_32 AC 181 ms
121,032 KB
testcase_33 AC 307 ms
170,908 KB
testcase_34 AC 305 ms
171,184 KB
testcase_35 AC 296 ms
161,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def Eratosthenes(N): #N以下の素数のリストを返す
    N+=1
    is_prime_list = [True]*N
    m = int(N**0.5)+1
    for i in range(3,m,2):
        if is_prime_list[i]:
            is_prime_list[i*i::2*i]=[False]*((N-i*i-1)//(2*i)+1)
    return [2] + [i for i in range(3,N,2) if is_prime_list[i]]

n,L = map(int,input().split())
ans = sum(max(0,L-p*(n-1)+1) for p in Eratosthenes(L//2+2))
print(ans)
0