結果
問題 |
No.407 鴨等素数間隔列の数え上げ
|
ユーザー |
![]() |
提出日時 | 2024-11-28 22:42:20 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 514 bytes |
コンパイル時間 | 560 ms |
コンパイル使用メモリ | 82,124 KB |
実行使用メモリ | 537,316 KB |
最終ジャッジ日時 | 2024-11-28 22:42:34 |
合計ジャッジ時間 | 14,036 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 MLE * 2 |
other | AC * 25 TLE * 5 MLE * 1 |
ソースコード
def seachPrimeNum(N): if N == 1: return [] max = int(N**0.5) seachList = [i for i in range(2,N+1)] primeNum = [] while seachList[0] <= max: primeNum.append(seachList[0]) tmp = seachList[0] seachList = [i for i in seachList if i % tmp != 0] primeNum.extend(seachList) return primeNum N,L = map(int,input().split()) if L // (N-1) > 1: PL = seachPrimeNum(L//(N-1)) else: print(0) exit() ans = 0 for p in PL: ans += (L-p*(N-1)+1) print(ans)