結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー Konton7Konton7
提出日時 2019-05-17 13:18:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 453 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 11,848 KB
実行使用メモリ 36,032 KB
最終ジャッジ日時 2023-10-17 07:17:08
合計ジャッジ時間 4,714 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,192 KB
testcase_01 AC 31 ms
10,152 KB
testcase_02 AC 30 ms
10,152 KB
testcase_03 AC 227 ms
16,180 KB
testcase_04 AC 30 ms
10,120 KB
testcase_05 AC 29 ms
10,192 KB
testcase_06 AC 29 ms
10,152 KB
testcase_07 AC 30 ms
10,152 KB
testcase_08 AC 30 ms
10,120 KB
testcase_09 AC 30 ms
10,192 KB
testcase_10 AC 30 ms
10,192 KB
testcase_11 AC 30 ms
10,152 KB
testcase_12 AC 30 ms
10,152 KB
testcase_13 AC 30 ms
10,192 KB
testcase_14 AC 30 ms
10,220 KB
testcase_15 AC 29 ms
10,152 KB
testcase_16 AC 30 ms
10,152 KB
testcase_17 AC 30 ms
10,192 KB
testcase_18 AC 30 ms
10,192 KB
testcase_19 TLE -
testcase_20 -- -
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:
    s = 0
    for i in range(len(anslist)):
        s += l + 1 - anslist[i] * (n-1)
    print(s)
0