結果

問題 No.136 Yet Another GCD Problem
ユーザー 👑 H20H20
提出日時 2022-01-04 01:28:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 463 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 82,544 KB
実行使用メモリ 73,304 KB
最終ジャッジ日時 2024-04-21 15:52:04
合計ジャッジ時間 3,037 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,480 KB
testcase_01 AC 45 ms
69,052 KB
testcase_02 AC 32 ms
51,968 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 36 ms
51,968 KB
testcase_09 AC 43 ms
66,432 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 41 ms
63,488 KB
testcase_24 WA -
testcase_25 AC 42 ms
63,616 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 34 ms
51,968 KB
testcase_32 WA -
testcase_33 AC 33 ms
52,268 KB
testcase_34 AC 39 ms
61,312 KB
testcase_35 AC 41 ms
64,384 KB
testcase_36 AC 44 ms
64,128 KB
testcase_37 AC 41 ms
61,568 KB
testcase_38 AC 34 ms
51,968 KB
testcase_39 AC 34 ms
51,712 KB
testcase_40 AC 34 ms
51,584 KB
testcase_41 AC 34 ms
51,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#約数
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N,K = map(int, input().split())
D = make_divisors(N)
ans = 1
for k in range(K):
    for d in D[::-1]:
        if d*K<=N:
            ans = max(d,ans)
print(ans)
0