結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー tookunn_1213tookunn_1213
提出日時 2016-08-06 00:10:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 394 ms / 1,000 ms
コード長 459 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,196 KB
実行使用メモリ 140,548 KB
最終ジャッジ日時 2023-08-06 21:03:17
合計ジャッジ時間 7,430 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 385 ms
140,280 KB
testcase_01 AC 186 ms
107,544 KB
testcase_02 AC 391 ms
140,360 KB
testcase_03 AC 133 ms
94,124 KB
testcase_04 AC 83 ms
77,552 KB
testcase_05 AC 70 ms
71,360 KB
testcase_06 AC 70 ms
71,340 KB
testcase_07 AC 88 ms
79,492 KB
testcase_08 AC 87 ms
78,912 KB
testcase_09 AC 160 ms
101,796 KB
testcase_10 AC 80 ms
76,120 KB
testcase_11 AC 77 ms
76,272 KB
testcase_12 AC 71 ms
71,228 KB
testcase_13 AC 76 ms
76,128 KB
testcase_14 AC 84 ms
78,244 KB
testcase_15 AC 76 ms
75,828 KB
testcase_16 AC 78 ms
76,040 KB
testcase_17 AC 77 ms
75,936 KB
testcase_18 AC 81 ms
76,660 KB
testcase_19 AC 384 ms
140,240 KB
testcase_20 AC 375 ms
140,548 KB
testcase_21 AC 70 ms
71,312 KB
testcase_22 AC 69 ms
71,412 KB
testcase_23 AC 73 ms
75,376 KB
testcase_24 AC 71 ms
71,452 KB
testcase_25 AC 393 ms
140,488 KB
testcase_26 AC 70 ms
71,556 KB
testcase_27 AC 70 ms
71,232 KB
testcase_28 AC 75 ms
71,268 KB
testcase_29 AC 70 ms
71,332 KB
testcase_30 AC 71 ms
71,212 KB
testcase_31 AC 72 ms
71,504 KB
testcase_32 AC 192 ms
107,664 KB
testcase_33 AC 392 ms
140,420 KB
testcase_34 AC 394 ms
140,488 KB
testcase_35 AC 189 ms
107,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,L = map(int,input().split())
def getPrimes():
	isPrime = [True for i in range(10000000 // (N - 1)+ 1)]
	isPrime[0] = isPrime[1] = False
	primes = []
	for i in range(2,10000000 // (N - 1)+ 1):
		if not isPrime[i]:
			continue
		j = 2
		while i * j <= 10000000 // (N - 1):
			isPrime[i * j] = False
			j += 1
		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