結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー yuki2006yuki2006
提出日時 2016-08-06 00:07:16
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 202 ms / 1,000 ms
コード長 328 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 77,756 KB
実行使用メモリ 117,644 KB
最終ジャッジ日時 2023-08-22 04:29:33
合計ジャッジ時間 4,563 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
76,464 KB
testcase_01 AC 74 ms
76,372 KB
testcase_02 AC 75 ms
76,144 KB
testcase_03 AC 84 ms
79,784 KB
testcase_04 AC 73 ms
76,408 KB
testcase_05 AC 72 ms
76,352 KB
testcase_06 AC 73 ms
76,152 KB
testcase_07 AC 75 ms
76,368 KB
testcase_08 AC 74 ms
76,204 KB
testcase_09 AC 75 ms
76,352 KB
testcase_10 AC 74 ms
76,396 KB
testcase_11 AC 75 ms
76,344 KB
testcase_12 AC 73 ms
76,412 KB
testcase_13 AC 73 ms
76,132 KB
testcase_14 AC 73 ms
77,040 KB
testcase_15 AC 74 ms
76,444 KB
testcase_16 AC 72 ms
76,484 KB
testcase_17 AC 73 ms
76,508 KB
testcase_18 AC 73 ms
76,624 KB
testcase_19 AC 89 ms
82,280 KB
testcase_20 AC 108 ms
90,092 KB
testcase_21 AC 74 ms
76,440 KB
testcase_22 AC 74 ms
76,412 KB
testcase_23 AC 71 ms
76,400 KB
testcase_24 AC 72 ms
76,440 KB
testcase_25 AC 129 ms
97,868 KB
testcase_26 AC 71 ms
76,664 KB
testcase_27 AC 72 ms
76,140 KB
testcase_28 AC 73 ms
76,464 KB
testcase_29 AC 71 ms
76,372 KB
testcase_30 AC 71 ms
76,140 KB
testcase_31 AC 73 ms
76,344 KB
testcase_32 AC 103 ms
87,968 KB
testcase_33 AC 202 ms
117,496 KB
testcase_34 AC 194 ms
117,644 KB
testcase_35 AC 118 ms
95,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

right = L / (N - 1)

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

print ans
0