結果

問題 No.2417 Div Count
ユーザー watayuwatayu
提出日時 2023-08-12 15:24:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 456 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 82,488 KB
実行使用メモリ 59,436 KB
最終ジャッジ日時 2024-04-30 09:13:41
合計ジャッジ時間 3,054 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,288 KB
testcase_01 AC 41 ms
53,576 KB
testcase_02 WA -
testcase_03 AC 37 ms
53,144 KB
testcase_04 AC 37 ms
53,564 KB
testcase_05 AC 36 ms
52,620 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 38 ms
52,836 KB
testcase_12 AC 37 ms
52,652 KB
testcase_13 AC 37 ms
52,868 KB
testcase_14 AC 37 ms
52,448 KB
testcase_15 WA -
testcase_16 AC 37 ms
53,628 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 40 ms
57,460 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 40 ms
57,356 KB
testcase_24 WA -
testcase_25 AC 41 ms
57,644 KB
testcase_26 AC 40 ms
57,132 KB
testcase_27 AC 40 ms
57,428 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 44 ms
56,984 KB
testcase_33 AC 42 ms
59,260 KB
testcase_34 WA -
testcase_35 AC 46 ms
58,928 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 56 ms
58,892 KB
testcase_39 AC 48 ms
58,768 KB
testcase_40 AC 44 ms
59,436 KB
testcase_41 AC 43 ms
59,044 KB
testcase_42 AC 37 ms
53,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

num,k = map(int, input().split())
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]
ans = make_divisors(num-k)
pos = 0
for i in range(len(ans)):
    if ans[i] > k:
        pos = i
        break
print(len(ans)-pos)
0