結果

問題 No.2417 Div Count
コンテスト
ユーザー 無貌
提出日時 2023-11-03 07:39:23
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 272 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 438 ms
コンパイル使用メモリ 20,828 KB
実行使用メモリ 15,580 KB
最終ジャッジ日時 2026-04-12 22:19:39
合計ジャッジ時間 6,134 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 3 WA * 38
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def divisor_count(x):
  div_cnt = 0
  for i in range(1, int(x**0.5) + 1):
    if x%i == 0:
      x //= i
      div_cnt += 1
      if x//i != i:
        div_cnt += 1
  return div_cnt

N, K = map(int, input().split())
ans = divisor_count(N-K)
print(ans if K == 0 else ans-1)
0