結果

問題 No.371 ぼく悪いプライムじゃないよ
ユーザー g-tetsuyag-tetsuya
提出日時 2016-05-22 09:08:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 448 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 17,024 KB
最終ジャッジ日時 2024-04-16 06:18:43
合計ジャッジ時間 3,587 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
16,128 KB
testcase_01 AC 31 ms
10,880 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 31 ms
10,880 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 31 ms
10,880 KB
testcase_10 AC 31 ms
10,752 KB
testcase_11 AC 31 ms
10,752 KB
testcase_12 AC 30 ms
10,752 KB
testcase_13 AC 43 ms
10,880 KB
testcase_14 AC 37 ms
10,880 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_prime(N):
    for i in range(2, N):
        if N % i == 0:
            return False
    return True

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

nums = [i for i in range(L,H+1)]

for n in nums:
    if is_prime(n):
        nums.remove(n)

for i in range(2, H):
    j = 0
    while len(nums) > j:
        if len(nums) == 1:
            ans = nums[j]
        if nums[j] % i == 0:
            nums.pop(j)
            continue
        j = j + 1

print(ans)
0