結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー eitahoeitaho
提出日時 2016-08-07 03:41:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 223 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 88,832 KB
最終ジャッジ日時 2024-04-24 19:42:50
合計ジャッジ時間 6,594 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,624 KB
testcase_01 AC 31 ms
10,496 KB
testcase_02 AC 31 ms
10,624 KB
testcase_03 AC 61 ms
12,800 KB
testcase_04 AC 30 ms
10,624 KB
testcase_05 AC 29 ms
10,496 KB
testcase_06 AC 29 ms
10,496 KB
testcase_07 AC 30 ms
10,624 KB
testcase_08 AC 30 ms
10,624 KB
testcase_09 AC 30 ms
10,624 KB
testcase_10 AC 30 ms
10,624 KB
testcase_11 AC 30 ms
10,624 KB
testcase_12 AC 29 ms
10,624 KB
testcase_13 AC 31 ms
10,624 KB
testcase_14 AC 30 ms
10,496 KB
testcase_15 AC 30 ms
10,624 KB
testcase_16 AC 30 ms
10,624 KB
testcase_17 AC 30 ms
10,624 KB
testcase_18 AC 30 ms
10,624 KB
testcase_19 AC 144 ms
18,432 KB
testcase_20 AC 372 ms
34,176 KB
testcase_21 AC 30 ms
10,624 KB
testcase_22 AC 30 ms
10,624 KB
testcase_23 AC 30 ms
10,624 KB
testcase_24 AC 30 ms
10,624 KB
testcase_25 AC 604 ms
49,792 KB
testcase_26 AC 29 ms
10,624 KB
testcase_27 AC 30 ms
10,624 KB
testcase_28 AC 30 ms
10,624 KB
testcase_29 AC 30 ms
10,624 KB
testcase_30 AC 30 ms
10,624 KB
testcase_31 AC 30 ms
10,624 KB
testcase_32 AC 305 ms
29,824 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 AC 546 ms
45,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, L = map(int, input().split())
M = L // (N - 1)
prime = [1] * (M + 1)
ans = 0

for p in range(2, M + 1):
    if prime[p]:
        ans += L - p * (N - 1) + 1
        prime[p + p:M + 1:p] = [0] * ((M - p) // p)

print(ans)
0