結果

問題 No.2417 Div Count
ユーザー 無貌
提出日時 2023-11-03 07:39:23
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 272 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-25 18:33:50
合計ジャッジ時間 3,137 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 3 WA * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

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