結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー yuki2006yuki2006
提出日時 2016-08-05 23:55:09
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 284 ms / 1,000 ms
コード長 286 bytes
コンパイル時間 2,295 ms
コンパイル使用メモリ 77,660 KB
実行使用メモリ 117,532 KB
最終ジャッジ日時 2023-08-22 04:26:38
合計ジャッジ時間 6,921 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
76,140 KB
testcase_01 AC 62 ms
76,336 KB
testcase_02 AC 63 ms
76,096 KB
testcase_03 AC 91 ms
79,324 KB
testcase_04 AC 70 ms
76,360 KB
testcase_05 AC 71 ms
76,244 KB
testcase_06 AC 64 ms
76,208 KB
testcase_07 AC 62 ms
76,160 KB
testcase_08 AC 64 ms
76,500 KB
testcase_09 AC 65 ms
76,204 KB
testcase_10 AC 63 ms
76,352 KB
testcase_11 AC 61 ms
76,376 KB
testcase_12 AC 61 ms
76,196 KB
testcase_13 AC 67 ms
76,144 KB
testcase_14 AC 65 ms
77,120 KB
testcase_15 AC 68 ms
76,396 KB
testcase_16 AC 63 ms
76,488 KB
testcase_17 AC 72 ms
76,560 KB
testcase_18 AC 69 ms
76,388 KB
testcase_19 AC 92 ms
82,324 KB
testcase_20 AC 129 ms
90,088 KB
testcase_21 AC 66 ms
76,444 KB
testcase_22 AC 64 ms
76,352 KB
testcase_23 AC 65 ms
76,428 KB
testcase_24 AC 64 ms
76,416 KB
testcase_25 AC 166 ms
98,004 KB
testcase_26 AC 66 ms
76,612 KB
testcase_27 AC 62 ms
76,492 KB
testcase_28 AC 63 ms
76,400 KB
testcase_29 AC 64 ms
76,468 KB
testcase_30 AC 66 ms
76,228 KB
testcase_31 AC 64 ms
76,404 KB
testcase_32 AC 120 ms
87,960 KB
testcase_33 AC 284 ms
117,448 KB
testcase_34 AC 266 ms
117,532 KB
testcase_35 AC 151 ms
95,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, L = map(int, raw_input().split())

right = L / (N - 1)

field = [True] * (right + 1)
i = 2
ans = 0
while i <= right:
    if field[i]:
        k = i * i
        while k <= right:
            field[k] = False
            k += i
        ans += L - i * (N - 1) + 1
    i += 1

print ans
0