結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー tookunn_1213tookunn_1213
提出日時 2016-08-06 00:39:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 446 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 68,864 KB
最終ジャッジ日時 2024-04-24 15:48:07
合計ジャッジ時間 24,734 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 317 ms
49,920 KB
testcase_01 AC 387 ms
49,920 KB
testcase_02 AC 234 ms
49,792 KB
testcase_03 TLE -
testcase_04 AC 219 ms
50,048 KB
testcase_05 AC 519 ms
49,792 KB
testcase_06 AC 418 ms
49,920 KB
testcase_07 AC 426 ms
49,792 KB
testcase_08 AC 223 ms
49,920 KB
testcase_09 AC 520 ms
49,920 KB
testcase_10 AC 319 ms
49,920 KB
testcase_11 AC 219 ms
49,792 KB
testcase_12 AC 219 ms
49,792 KB
testcase_13 AC 391 ms
49,920 KB
testcase_14 AC 927 ms
49,792 KB
testcase_15 AC 226 ms
49,792 KB
testcase_16 AC 504 ms
49,792 KB
testcase_17 AC 330 ms
49,920 KB
testcase_18 AC 526 ms
49,920 KB
testcase_19 TLE -
testcase_20 TLE -
testcase_21 AC 220 ms
49,920 KB
testcase_22 AC 227 ms
49,792 KB
testcase_23 AC 759 ms
49,920 KB
testcase_24 AC 381 ms
49,792 KB
testcase_25 TLE -
testcase_26 AC 422 ms
49,792 KB
testcase_27 AC 218 ms
49,792 KB
testcase_28 AC 392 ms
49,792 KB
testcase_29 AC 524 ms
49,920 KB
testcase_30 AC 231 ms
49,920 KB
testcase_31 AC 633 ms
49,792 KB
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,L = map(int,input().split())
def getPrimes():
	isPrime = [True for i in range(4999999 + 1)]
	isPrime[0] = isPrime[1] = False
	primes = []
	for i in range(2,4999999 + 1):
		if not isPrime[i]:
			continue
		if L < i * (N - 1):
			break
		for j in range(i * 2,4999999 + 1,i):
			isPrime[j] = False
		primes.append(i)
	return primes
primes = getPrimes()
ans = 0
for p in primes:
	if L < p * (N - 1):
		break
	ans += (L - p * (N - 1)) + 1
print(ans)
0