結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー takakintakakin
提出日時 2020-06-01 22:53:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 442 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 63,616 KB
最終ジャッジ日時 2024-05-02 03:35:51
合計ジャッジ時間 7,491 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,624 KB
testcase_01 AC 30 ms
10,624 KB
testcase_02 RE -
testcase_03 AC 55 ms
12,288 KB
testcase_04 AC 29 ms
10,752 KB
testcase_05 AC 30 ms
10,624 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 30 ms
10,624 KB
testcase_08 AC 30 ms
10,624 KB
testcase_09 AC 30 ms
10,624 KB
testcase_10 AC 30 ms
10,752 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 30 ms
10,624 KB
testcase_14 AC 30 ms
10,752 KB
testcase_15 RE -
testcase_16 AC 30 ms
10,624 KB
testcase_17 AC 30 ms
10,752 KB
testcase_18 AC 30 ms
10,624 KB
testcase_19 AC 122 ms
16,256 KB
testcase_20 AC 407 ms
26,880 KB
testcase_21 AC 30 ms
10,624 KB
testcase_22 AC 30 ms
10,624 KB
testcase_23 AC 30 ms
10,624 KB
testcase_24 AC 31 ms
10,752 KB
testcase_25 AC 670 ms
37,376 KB
testcase_26 AC 31 ms
10,624 KB
testcase_27 RE -
testcase_28 AC 31 ms
10,624 KB
testcase_29 AC 30 ms
10,624 KB
testcase_30 AC 29 ms
10,752 KB
testcase_31 AC 30 ms
10,624 KB
testcase_32 AC 309 ms
24,064 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 AC 603 ms
34,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n,l=map(int,input().split())
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]]
P=primes(l//(n-1))
ans=0
for p in P:
  if (n-1)*p>l:
    break
  else:
    ans+=l-(n-1)*p+1
print(ans)
0