結果

問題 No.371 ぼく悪いプライムじゃないよ
ユーザー nebukuro09nebukuro09
提出日時 2016-10-12 10:04:08
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 452 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 7,424 KB
最終ジャッジ日時 2024-05-01 20:18:11
合計ジャッジ時間 2,660 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
7,040 KB
testcase_01 AC 32 ms
7,168 KB
testcase_02 AC 32 ms
7,168 KB
testcase_03 AC 32 ms
7,296 KB
testcase_04 AC 31 ms
7,168 KB
testcase_05 AC 31 ms
7,168 KB
testcase_06 AC 31 ms
7,168 KB
testcase_07 AC 31 ms
7,168 KB
testcase_08 AC 30 ms
7,040 KB
testcase_09 AC 30 ms
7,168 KB
testcase_10 AC 30 ms
7,168 KB
testcase_11 AC 30 ms
7,168 KB
testcase_12 AC 31 ms
7,168 KB
testcase_13 AC 30 ms
7,296 KB
testcase_14 AC 33 ms
7,040 KB
testcase_15 AC 32 ms
7,296 KB
testcase_16 AC 30 ms
7,168 KB
testcase_17 AC 30 ms
7,296 KB
testcase_18 AC 31 ms
7,040 KB
testcase_19 AC 31 ms
7,040 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 30 ms
7,168 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