結果
| 問題 | 
                            No.1973 Divisor Sequence
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-06-10 23:53:54 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 606 bytes | 
| コンパイル時間 | 176 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 51,272 KB | 
| 最終ジャッジ日時 | 2024-09-21 07:04:22 | 
| 合計ジャッジ時間 | 7,140 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 TLE * 1 | 
| other | -- * 22 | 
ソースコード
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)