結果
問題 |
No.371 ぼく悪いプライムじゃないよ
|
ユーザー |
|
提出日時 | 2016-05-22 09:27:18 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 495 bytes |
コンパイル時間 | 126 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 60,672 KB |
最終ジャッジ日時 | 2024-10-06 19:29:51 |
合計ジャッジ時間 | 3,971 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 10 WA * 5 RE * 1 TLE * 1 -- * 25 |
ソースコード
def is_prime(N): i = 2 while i * i < N: if N % i == 0: return False i += 1 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) i = 2 while i * i < H: j = 0 while len(nums) > j: if len(nums) == 1: ans = nums[j] break if nums[j] % i == 0: nums.pop(j) continue j += 1 i += 1 print(ans)