結果
| 問題 | No.407 鴨等素数間隔列の数え上げ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-25 16:16:32 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 532 ms / 1,000 ms |
| コード長 | 368 bytes |
| 記録 | |
| コンパイル時間 | 180 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 159,360 KB |
| 最終ジャッジ日時 | 2026-04-13 13:48:06 |
| 合計ジャッジ時間 | 6,281 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 31 |
ソースコード
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)