結果
| 問題 |
No.371 ぼく悪いプライムじゃないよ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-05-22 09:08:32 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 448 bytes |
| コンパイル時間 | 488 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 16,512 KB |
| 最終ジャッジ日時 | 2024-10-06 19:29:43 |
| 合計ジャッジ時間 | 3,697 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 11 TLE * 1 -- * 30 |
ソースコード
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)