結果

問題 No.2051 Divide
ユーザー titan23titan23
提出日時 2022-10-06 23:47:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 589 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 76,680 KB
最終ジャッジ日時 2023-09-02 03:29:53
合計ジャッジ時間 4,302 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,788 KB
testcase_01 AC 74 ms
71,356 KB
testcase_02 AC 76 ms
75,924 KB
testcase_03 AC 76 ms
75,760 KB
testcase_04 AC 75 ms
75,792 KB
testcase_05 AC 75 ms
76,140 KB
testcase_06 AC 75 ms
75,804 KB
testcase_07 AC 73 ms
75,784 KB
testcase_08 AC 75 ms
75,760 KB
testcase_09 AC 78 ms
75,740 KB
testcase_10 AC 74 ms
75,768 KB
testcase_11 AC 76 ms
75,920 KB
testcase_12 AC 76 ms
75,764 KB
testcase_13 AC 76 ms
75,580 KB
testcase_14 AC 76 ms
75,772 KB
testcase_15 AC 77 ms
75,548 KB
testcase_16 AC 77 ms
75,948 KB
testcase_17 AC 79 ms
76,680 KB
testcase_18 AC 76 ms
75,832 KB
testcase_19 AC 77 ms
75,760 KB
testcase_20 AC 77 ms
75,748 KB
testcase_21 AC 76 ms
75,776 KB
testcase_22 AC 75 ms
75,528 KB
testcase_23 AC 75 ms
75,820 KB
testcase_24 AC 77 ms
75,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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