結果
| 問題 |
No.136 Yet Another GCD Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-05-13 10:49:00 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 480 bytes |
| コンパイル時間 | 119 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-07-07 03:31:06 |
| 合計ジャッジ時間 | 2,798 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 39 |
ソースコード
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n//i)
divisors.sort()
return divisors
N, K = map(int, input().split())
l_divisors = make_divisors(N)
l_divisors = l_divisors[1:]
ans_pair = N
for li in l_divisors:
if li <= K:
ans_pair = li
break
if ans_pair == N:
print(1)
else:
print(N // ans_pair)