結果
問題 |
No.407 鴨等素数間隔列の数え上げ
|
ユーザー |
![]() |
提出日時 | 2020-06-01 22:53:55 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 442 bytes |
コンパイル時間 | 179 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 63,616 KB |
最終ジャッジ日時 | 2024-11-22 13:52:50 |
合計ジャッジ時間 | 6,761 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 RE * 1 |
other | AC * 25 RE * 4 TLE * 2 |
ソースコード
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)