結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー 👑 yumechiyumechi
提出日時 2016-08-26 00:16:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 440 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 82,328 KB
実行使用メモリ 61,476 KB
最終ジャッジ日時 2024-04-25 17:00:28
合計ジャッジ時間 2,507 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,540 KB
testcase_01 AC 37 ms
52,932 KB
testcase_02 AC 35 ms
52,068 KB
testcase_03 WA -
testcase_04 AC 35 ms
53,076 KB
testcase_05 AC 43 ms
61,128 KB
testcase_06 AC 40 ms
60,328 KB
testcase_07 AC 34 ms
52,432 KB
testcase_08 AC 34 ms
52,744 KB
testcase_09 WA -
testcase_10 AC 35 ms
52,652 KB
testcase_11 AC 38 ms
52,528 KB
testcase_12 AC 38 ms
57,888 KB
testcase_13 AC 35 ms
53,000 KB
testcase_14 WA -
testcase_15 AC 35 ms
52,140 KB
testcase_16 AC 34 ms
53,260 KB
testcase_17 AC 34 ms
53,284 KB
testcase_18 AC 35 ms
52,284 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 39 ms
58,736 KB
testcase_22 AC 37 ms
58,520 KB
testcase_23 AC 40 ms
60,224 KB
testcase_24 AC 41 ms
60,208 KB
testcase_25 WA -
testcase_26 AC 41 ms
60,744 KB
testcase_27 AC 37 ms
59,436 KB
testcase_28 AC 39 ms
58,988 KB
testcase_29 AC 41 ms
61,476 KB
testcase_30 AC 39 ms
58,292 KB
testcase_31 AC 42 ms
60,392 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt

def solve():
    n, l = map(int, input().split())
    ans = 0
    primes = ()
    for i in range(2, int(sqrt(l)) + 1):
        for j in primes:
            if i % j == 0:
                break
        else:
            primes = primes + (i,)

    for prime in primes:
        if (l + 1) < (n - 1) * prime:
            break
        ans += (l + 1) - (n - 1) * prime
    print(ans)

if __name__=="__main__":
    solve()
0