結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー Konton7Konton7
提出日時 2019-05-17 00:51:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 434 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 11,940 KB
実行使用メモリ 79,136 KB
最終ジャッジ日時 2023-10-17 07:06:52
合計ジャッジ時間 6,147 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
14,568 KB
testcase_01 AC 29 ms
10,176 KB
testcase_02 AC 29 ms
10,176 KB
testcase_03 AC 220 ms
16,188 KB
testcase_04 AC 30 ms
10,144 KB
testcase_05 AC 30 ms
10,200 KB
testcase_06 AC 29 ms
10,176 KB
testcase_07 AC 30 ms
10,176 KB
testcase_08 AC 29 ms
10,144 KB
testcase_09 AC 29 ms
10,200 KB
testcase_10 AC 29 ms
10,200 KB
testcase_11 AC 30 ms
10,176 KB
testcase_12 AC 29 ms
10,176 KB
testcase_13 AC 29 ms
10,200 KB
testcase_14 AC 31 ms
10,224 KB
testcase_15 AC 29 ms
10,176 KB
testcase_16 AC 29 ms
10,176 KB
testcase_17 AC 29 ms
10,200 KB
testcase_18 AC 29 ms
10,200 KB
testcase_19 TLE -
testcase_20 TLE -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, l = [ int(v) for v in input().split() ]
def shave(a):
    aroot = int(a**0.5)
    modlist = [2] + [i for i in range(3,aroot+1,2)]
    outlist = [i for i in range(2,a+1)]

    for j in modlist:
        outlist = [i for i in outlist if i % j != 0 or i == j]
    return outlist

dmax = l // (n-1)
anslist = shave(dmax)

if anslist == 0:
    print(0)

else:
    anslist = [ l + 1 - i * (n-1)  for i in anslist]
    print(sum(anslist))
0