結果

問題 No.1973 Divisor Sequence
ユーザー candy-concandy-con
提出日時 2022-06-10 23:53:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 606 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 11,748 KB
実行使用メモリ 47,128 KB
最終ジャッジ日時 2023-10-21 05:54:35
合計ジャッジ時間 7,449 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 492 ms
42,340 KB
testcase_01 AC 518 ms
42,340 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import numpy as np
num, M = map(int,input().split())
count = 0
yakusuu = []
if M == 1:
  print(1)
elif M > 1:
  for i in range(1, M+1):
    if M % i == 0:
        yakusuu.append(i)
  for sequence in itertools.combinations_with_replacement(yakusuu,num):
    if np.prod(sequence) <= M and np.prod(sequence)== 1:
      count += 1
    if np.prod(sequence) >= 2 and np.prod(sequence) <= M and np.prod(sequence)// (sum(sequence)/2) == sum(sequence)/2:
      count += 1
    elif np.prod(sequence) <= M and np.prod(sequence) // (sum(sequence)/2) != sum(sequence)/2:
      count += 2
  print(count)
0