結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー yuki2006yuki2006
提出日時 2016-08-05 23:54:48
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 286 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 50,816 KB
最終ジャッジ日時 2024-05-02 02:12:58
合計ジャッジ時間 6,760 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
11,520 KB
testcase_01 AC 9 ms
6,144 KB
testcase_02 AC 9 ms
6,272 KB
testcase_03 AC 85 ms
7,296 KB
testcase_04 AC 10 ms
6,144 KB
testcase_05 AC 10 ms
6,144 KB
testcase_06 AC 9 ms
6,016 KB
testcase_07 AC 9 ms
6,016 KB
testcase_08 AC 9 ms
6,272 KB
testcase_09 AC 9 ms
6,272 KB
testcase_10 AC 10 ms
6,144 KB
testcase_11 AC 8 ms
6,144 KB
testcase_12 AC 9 ms
6,272 KB
testcase_13 AC 9 ms
6,144 KB
testcase_14 AC 9 ms
6,272 KB
testcase_15 AC 8 ms
6,144 KB
testcase_16 AC 9 ms
6,272 KB
testcase_17 AC 9 ms
6,144 KB
testcase_18 AC 9 ms
6,272 KB
testcase_19 AC 279 ms
10,112 KB
testcase_20 AC 865 ms
18,048 KB
testcase_21 AC 10 ms
6,272 KB
testcase_22 AC 9 ms
6,144 KB
testcase_23 AC 10 ms
6,144 KB
testcase_24 AC 10 ms
6,272 KB
testcase_25 TLE -
testcase_26 AC 9 ms
6,144 KB
testcase_27 AC 9 ms
6,144 KB
testcase_28 AC 10 ms
6,272 KB
testcase_29 AC 9 ms
6,144 KB
testcase_30 AC 9 ms
6,144 KB
testcase_31 AC 9 ms
6,272 KB
testcase_32 AC 701 ms
15,744 KB
testcase_33 TLE -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

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