結果

問題 No.371 ぼく悪いプライムじゃないよ
ユーザー nebukuro09nebukuro09
提出日時 2016-10-12 10:03:53
言語 PyPy2
(7.3.15)
結果
RE  
実行時間 -
コード長 452 bytes
コンパイル時間 1,169 ms
コンパイル使用メモリ 76,928 KB
実行使用メモリ 77,952 KB
最終ジャッジ日時 2024-05-01 20:18:05
合計ジャッジ時間 5,102 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
77,088 KB
testcase_01 AC 76 ms
77,436 KB
testcase_02 AC 75 ms
76,928 KB
testcase_03 AC 76 ms
77,312 KB
testcase_04 AC 76 ms
77,568 KB
testcase_05 AC 76 ms
76,928 KB
testcase_06 AC 77 ms
76,800 KB
testcase_07 AC 78 ms
77,184 KB
testcase_08 AC 80 ms
77,312 KB
testcase_09 AC 77 ms
77,312 KB
testcase_10 AC 77 ms
77,312 KB
testcase_11 AC 77 ms
77,184 KB
testcase_12 AC 77 ms
77,312 KB
testcase_13 AC 78 ms
76,996 KB
testcase_14 AC 77 ms
77,440 KB
testcase_15 AC 78 ms
77,824 KB
testcase_16 AC 77 ms
77,240 KB
testcase_17 AC 78 ms
77,568 KB
testcase_18 AC 79 ms
77,312 KB
testcase_19 AC 77 ms
77,440 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 AC 76 ms
77,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_table(n):
    table = [0 for _ in xrange(n+1)]
    i = 2
    while i * i <= n:
        if table[i] == 0:
            j = i + i
            while j <= n:
                if table[j] == 0:
                    table[j] = i
                j += i
        i += 1
    return table

L, H = map(int, raw_input().split())
pt = prime_table(10**5+1)
mv, mi = 0, -1
for i in xrange(L, H+1):
    if pt[i] >= mv:
        mv = pt[i]
        mi = i
print mi
0