結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー tookunn_1213tookunn_1213
提出日時 2016-08-06 00:41:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 457 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 63,488 KB
最終ジャッジ日時 2024-04-24 15:48:38
合計ジャッジ時間 6,095 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,880 KB
testcase_01 AC 27 ms
10,752 KB
testcase_02 RE -
testcase_03 AC 60 ms
12,032 KB
testcase_04 AC 26 ms
10,752 KB
testcase_05 AC 24 ms
10,752 KB
testcase_06 AC 27 ms
10,624 KB
testcase_07 AC 26 ms
10,624 KB
testcase_08 AC 25 ms
10,496 KB
testcase_09 AC 26 ms
10,752 KB
testcase_10 AC 26 ms
10,624 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 29 ms
10,624 KB
testcase_14 AC 27 ms
10,624 KB
testcase_15 RE -
testcase_16 AC 26 ms
10,752 KB
testcase_17 AC 26 ms
10,752 KB
testcase_18 AC 25 ms
10,496 KB
testcase_19 AC 148 ms
16,256 KB
testcase_20 AC 441 ms
26,752 KB
testcase_21 AC 27 ms
10,624 KB
testcase_22 AC 27 ms
10,624 KB
testcase_23 AC 25 ms
10,624 KB
testcase_24 AC 25 ms
10,624 KB
testcase_25 AC 779 ms
37,248 KB
testcase_26 AC 26 ms
10,752 KB
testcase_27 RE -
testcase_28 AC 24 ms
10,624 KB
testcase_29 AC 25 ms
10,624 KB
testcase_30 AC 25 ms
10,752 KB
testcase_31 AC 25 ms
10,624 KB
testcase_32 AC 338 ms
23,936 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 AC 685 ms
35,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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