結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー TawaraTawara
提出日時 2016-08-05 22:45:40
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 406 bytes
コンパイル時間 1,578 ms
コンパイル使用メモリ 76,544 KB
実行使用メモリ 115,712 KB
最終ジャッジ日時 2024-04-24 15:57:32
合計ジャッジ時間 5,210 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 89 ms
75,392 KB
testcase_02 AC 78 ms
75,264 KB
testcase_03 AC 99 ms
77,568 KB
testcase_04 AC 77 ms
75,776 KB
testcase_05 AC 76 ms
75,648 KB
testcase_06 AC 76 ms
75,392 KB
testcase_07 AC 77 ms
75,776 KB
testcase_08 AC 76 ms
75,520 KB
testcase_09 AC 76 ms
75,520 KB
testcase_10 AC 78 ms
75,392 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 78 ms
75,264 KB
testcase_14 AC 79 ms
76,416 KB
testcase_15 RE -
testcase_16 AC 77 ms
75,904 KB
testcase_17 AC 78 ms
75,520 KB
testcase_18 AC 76 ms
75,264 KB
testcase_19 AC 92 ms
80,512 KB
testcase_20 AC 114 ms
88,320 KB
testcase_21 AC 78 ms
75,520 KB
testcase_22 AC 76 ms
75,264 KB
testcase_23 AC 78 ms
75,648 KB
testcase_24 AC 79 ms
75,776 KB
testcase_25 AC 133 ms
96,128 KB
testcase_26 AC 78 ms
75,648 KB
testcase_27 RE -
testcase_28 AC 78 ms
75,776 KB
testcase_29 AC 77 ms
75,648 KB
testcase_30 AC 81 ms
75,264 KB
testcase_31 AC 77 ms
75,392 KB
testcase_32 AC 108 ms
86,656 KB
testcase_33 AC 223 ms
115,712 KB
testcase_34 AC 216 ms
115,712 KB
testcase_35 AC 126 ms
94,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
def sieve (n):
	check = [1]*(n+1)
	check[0] = check[1] = 0
	for d in xrange(2,int(math.sqrt(n))+1):
		if check[d] == 0: continue
		for comp in xrange(d*2,n+1,d):
			check[comp] = 0
	return check
N,L = map(int,raw_input().split())
if L < 6:
	print 0
	quit()
prime = sieve(L/(N-1))
M = 0
for i in xrange(2,L/(N-1)+1):
	if prime[i] == 0:
		continue
	if i * (N-1) <= L:
		M += L+1 - i*(N-1)
print M
0