結果

問題 No.2051 Divide
コンテスト
ユーザー titan23
提出日時 2022-10-06 23:47:42
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 364 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 341 ms
コンパイル使用メモリ 85,416 KB
実行使用メモリ 59,880 KB
最終ジャッジ日時 2026-03-04 11:56:34
合計ジャッジ時間 1,765 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def get_divisors(n: int) -> list:
  lower_divisors, upper_divisors = [], []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      lower_divisors.append(i)
      if i != n // i:
        upper_divisors.append(n//i)
  return lower_divisors + upper_divisors[::-1]

a, b = map(int, input().split())
div = get_divisors(a)
print(sum(1 for a in div if a % b == 0))
0