結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-11-25 16:16:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 851 ms / 1,000 ms
コード長 368 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 154,268 KB
最終ジャッジ日時 2023-11-25 16:16:43
合計ジャッジ時間 9,510 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
55,596 KB
testcase_01 AC 45 ms
55,596 KB
testcase_02 AC 45 ms
55,596 KB
testcase_03 AC 94 ms
76,124 KB
testcase_04 AC 44 ms
55,596 KB
testcase_05 AC 818 ms
150,676 KB
testcase_06 AC 457 ms
117,084 KB
testcase_07 AC 47 ms
55,596 KB
testcase_08 AC 46 ms
55,596 KB
testcase_09 AC 45 ms
55,596 KB
testcase_10 AC 51 ms
61,568 KB
testcase_11 AC 45 ms
55,596 KB
testcase_12 AC 60 ms
64,868 KB
testcase_13 AC 58 ms
64,460 KB
testcase_14 AC 54 ms
64,832 KB
testcase_15 AC 49 ms
61,568 KB
testcase_16 AC 53 ms
64,460 KB
testcase_17 AC 51 ms
63,820 KB
testcase_18 AC 51 ms
61,696 KB
testcase_19 AC 98 ms
76,408 KB
testcase_20 AC 236 ms
96,132 KB
testcase_21 AC 116 ms
78,776 KB
testcase_22 AC 101 ms
74,852 KB
testcase_23 AC 153 ms
85,720 KB
testcase_24 AC 253 ms
96,116 KB
testcase_25 AC 452 ms
115,200 KB
testcase_26 AC 427 ms
115,196 KB
testcase_27 AC 82 ms
71,984 KB
testcase_28 AC 187 ms
87,508 KB
testcase_29 AC 421 ms
113,944 KB
testcase_30 AC 88 ms
73,208 KB
testcase_31 AC 300 ms
105,236 KB
testcase_32 AC 449 ms
114,496 KB
testcase_33 AC 827 ms
154,268 KB
testcase_34 AC 851 ms
154,268 KB
testcase_35 AC 772 ms
146,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

N,L = map(int,input().split())

ans = 0

sieve = [False]*(L+1)
sieve[1] = 1
for i in range(2,L+1):
    if sieve[i]:
        continue
    ans += max(0,L - (N-1)*i + 1)
    for j in range(i,L+1,i):
        sieve[j] = True
print(ans)
0