結果
| 問題 |
No.3253 Banned Product
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-09-08 19:57:07 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 618 bytes |
| コンパイル時間 | 449 ms |
| コンパイル使用メモリ | 82,756 KB |
| 実行使用メモリ | 69,004 KB |
| 最終ジャッジ日時 | 2025-09-08 19:57:11 |
| 合計ジャッジ時間 | 3,640 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 WA * 1 |
ソースコード
def divisors(n: int) -> list[int]:
"""n の約数を求める"""
s = set()
p = 1
while p * p <= n:
if n % p == 0:
s.add(p)
s.add(n // p)
p += 1
return sorted(s)
def solve():
N, K = map(int, input().split())
for x in reversed(range(max(1, N-218), N+1)):
ok = True
for d in divisors(x):
a = d
b = x // d
if a <= K and b <= K:
ok = False
break
if ok:
return x
return -1
T = int(input())
for _ in range(T):
ans = solve()
print(ans)
norioc