結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー 👑 rin204rin204
提出日時 2022-01-20 03:03:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 500 ms / 1,000 ms
コード長 364 bytes
コンパイル時間 424 ms
コンパイル使用メモリ 86,844 KB
実行使用メモリ 154,936 KB
最終ジャッジ日時 2023-08-15 08:21:53
合計ジャッジ時間 19,415 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 490 ms
154,624 KB
testcase_01 AC 462 ms
154,924 KB
testcase_02 AC 483 ms
154,596 KB
testcase_03 AC 460 ms
154,684 KB
testcase_04 AC 453 ms
154,752 KB
testcase_05 AC 500 ms
154,648 KB
testcase_06 AC 476 ms
154,560 KB
testcase_07 AC 454 ms
154,780 KB
testcase_08 AC 440 ms
154,448 KB
testcase_09 AC 450 ms
154,804 KB
testcase_10 AC 465 ms
154,772 KB
testcase_11 AC 463 ms
154,668 KB
testcase_12 AC 460 ms
154,864 KB
testcase_13 AC 447 ms
154,800 KB
testcase_14 AC 447 ms
154,544 KB
testcase_15 AC 448 ms
154,664 KB
testcase_16 AC 446 ms
154,936 KB
testcase_17 AC 464 ms
154,792 KB
testcase_18 AC 466 ms
154,604 KB
testcase_19 AC 482 ms
154,540 KB
testcase_20 AC 466 ms
154,688 KB
testcase_21 AC 461 ms
154,776 KB
testcase_22 AC 494 ms
154,644 KB
testcase_23 AC 451 ms
154,472 KB
testcase_24 AC 467 ms
154,544 KB
testcase_25 AC 462 ms
154,812 KB
testcase_26 AC 474 ms
154,512 KB
testcase_27 AC 455 ms
154,920 KB
testcase_28 AC 464 ms
154,736 KB
testcase_29 AC 474 ms
154,688 KB
testcase_30 AC 475 ms
154,864 KB
testcase_31 AC 471 ms
154,716 KB
testcase_32 AC 459 ms
154,604 KB
testcase_33 AC 500 ms
154,608 KB
testcase_34 AC 474 ms
154,676 KB
testcase_35 AC 469 ms
154,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = 10000010
isprime = [True] * N
isprime[0] = isprime[1] = False
for i in range(2, int(N ** 0.5 + 1)):
    if not isprime[i]:
        continue
    for j in range(i * i, N, i):
        isprime[j] = False

n, l = map(int, input().split())
ans = 0
for d in range(l):
    if not isprime[d]:
        continue
    x = d * (n - 1)
    ans += max(0, l - x + 1)
print(ans)
0