結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー 👑 yumechiyumechi
提出日時 2016-08-26 00:06:28
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 432 bytes
コンパイル時間 348 ms
コンパイル使用メモリ 82,564 KB
実行使用メモリ 85,548 KB
最終ジャッジ日時 2024-04-25 16:59:26
合計ジャッジ時間 5,322 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
60,552 KB
testcase_01 AC 37 ms
52,716 KB
testcase_02 AC 37 ms
53,212 KB
testcase_03 TLE -
testcase_04 AC 37 ms
53,140 KB
testcase_05 AC 36 ms
52,420 KB
testcase_06 AC 38 ms
53,128 KB
testcase_07 AC 38 ms
53,992 KB
testcase_08 AC 37 ms
53,744 KB
testcase_09 AC 37 ms
52,604 KB
testcase_10 WA -
testcase_11 AC 37 ms
52,388 KB
testcase_12 AC 37 ms
52,064 KB
testcase_13 AC 37 ms
53,292 KB
testcase_14 AC 41 ms
59,896 KB
testcase_15 AC 38 ms
53,004 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 37 ms
52,332 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 #

from math import sqrt

def solve():
    n, l = map(int, input().split())
    ans = 0
    primes = ()
    i = 2
    while i < (l // (n - 2)):
        for j in primes:
            if i % j == 0:
                break
        else:
            primes = primes + (i,)
            if (l + 1) < (n - 1) * i:
                break
            ans += (l + 1) - (n - 1) * i
        i += 1
    print(ans)

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