結果
問題 | No.1973 Divisor Sequence |
ユーザー |
![]() |
提出日時 | 2022-06-11 10:17:02 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 546 bytes |
コンパイル時間 | 160 ms |
コンパイル使用メモリ | 81,908 KB |
実行使用メモリ | 83,448 KB |
最終ジャッジ日時 | 2024-09-21 18:57:28 |
合計ジャッジ時間 | 6,838 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 TLE * 1 -- * 10 |
ソースコード
n,m = map(int,input().split()) divs = set() cnt = 1 while cnt ** 2 <= m: if m % cnt == 0: divs.add(cnt) divs.add(m//cnt) cnt += 1 divs_l = list(sorted(divs)) nn = len(divs) dp = [1]*nn mod = 10 ** 9 + 7 ok = [[] for _ in range(nn)] for i in range(nn): for j in range(nn): if divs_l[i] * divs_l[j] in divs: ok[i].append(j) for i in range(1,n): n_dp = [0]*nn for j in range(nn): for e in ok[j]: n_dp[j] += dp[e] n_dp[j] %= mod dp = n_dp print(sum(dp)%mod)