結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー syunsukesyunsuke
提出日時 2019-09-18 23:03:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 1,817 ms
コンパイル使用メモリ 86,380 KB
実行使用メモリ 155,208 KB
最終ジャッジ日時 2023-09-24 20:48:32
合計ジャッジ時間 15,145 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 161 ms
154,228 KB
testcase_01 AC 165 ms
154,040 KB
testcase_02 AC 164 ms
154,320 KB
testcase_03 WA -
testcase_04 AC 163 ms
154,216 KB
testcase_05 AC 632 ms
154,772 KB
testcase_06 AC 497 ms
154,768 KB
testcase_07 AC 150 ms
154,080 KB
testcase_08 AC 159 ms
154,260 KB
testcase_09 WA -
testcase_10 AC 283 ms
154,220 KB
testcase_11 AC 163 ms
153,912 KB
testcase_12 AC 334 ms
154,412 KB
testcase_13 AC 334 ms
154,312 KB
testcase_14 WA -
testcase_15 AC 311 ms
154,744 KB
testcase_16 AC 318 ms
154,776 KB
testcase_17 AC 331 ms
154,776 KB
testcase_18 AC 332 ms
154,396 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 348 ms
154,412 KB
testcase_22 AC 347 ms
154,764 KB
testcase_23 AC 380 ms
154,760 KB
testcase_24 AC 410 ms
154,556 KB
testcase_25 WA -
testcase_26 AC 473 ms
154,952 KB
testcase_27 AC 342 ms
154,576 KB
testcase_28 AC 393 ms
154,680 KB
testcase_29 AC 477 ms
154,416 KB
testcase_30 AC 338 ms
154,412 KB
testcase_31 AC 452 ms
154,408 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

S=[1 for i in range(10**7+1)]
S[0]=0
S[1]=0
for i in range(2,10**7):
    if S[i]==1:
        for j in range(2,10**7):
            if i*j>L:
                break
            else:
                S[i*j]=0
#print(S[:6])
ans=0
for i in range(N):
    if S[i]==1:
        if (N-1)*i<=L:
            ans+=(L-(N-1)*i+1)
        else:
            break
print(ans)
0