結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー tookunn_1213tookunn_1213
提出日時 2016-08-06 00:42:07
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 457 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 130,612 KB
最終ジャッジ日時 2024-04-24 15:48:44
合計ジャッジ時間 4,190 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
51,968 KB
testcase_01 AC 39 ms
51,840 KB
testcase_02 RE -
testcase_03 AC 58 ms
63,744 KB
testcase_04 AC 39 ms
51,968 KB
testcase_05 AC 39 ms
51,968 KB
testcase_06 AC 40 ms
51,968 KB
testcase_07 AC 40 ms
52,096 KB
testcase_08 AC 45 ms
52,480 KB
testcase_09 AC 39 ms
51,712 KB
testcase_10 AC 40 ms
51,968 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 44 ms
52,224 KB
testcase_14 AC 45 ms
57,600 KB
testcase_15 RE -
testcase_16 AC 39 ms
51,968 KB
testcase_17 AC 41 ms
51,968 KB
testcase_18 AC 39 ms
52,352 KB
testcase_19 AC 74 ms
70,912 KB
testcase_20 AC 127 ms
88,192 KB
testcase_21 AC 40 ms
52,096 KB
testcase_22 AC 39 ms
52,096 KB
testcase_23 AC 40 ms
51,968 KB
testcase_24 AC 40 ms
51,968 KB
testcase_25 AC 188 ms
105,088 KB
testcase_26 AC 40 ms
52,096 KB
testcase_27 RE -
testcase_28 AC 44 ms
51,968 KB
testcase_29 AC 44 ms
51,968 KB
testcase_30 AC 43 ms
51,712 KB
testcase_31 AC 40 ms
51,968 KB
testcase_32 AC 111 ms
84,096 KB
testcase_33 AC 430 ms
130,484 KB
testcase_34 AC 417 ms
130,612 KB
testcase_35 AC 173 ms
102,144 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