結果
| 問題 | No.1731 Product of Subsequence |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-29 13:15:40 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
RE
不安定
|
| 実行時間 | - |
| コード長 | 270 bytes |
| 記録 | |
| コンパイル時間 | 64 ms |
| コンパイル使用メモリ | 80,956 KB |
| 実行使用メモリ | 92,936 KB |
| 最終ジャッジ日時 | 2026-10-10 03:01:06 |
| 合計ジャッジ時間 | 8,952 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 RE * 1 |
| other | AC * 28 RE * 3 |
ソースコード
import math
N, K, *A = map(int, open(0).read().split())
M = 1000000007
dp = {1: 1}
for a in A:
for n, c in dp.copy().items():
g = math.gcd(a * n, K)
if g in dp:
dp[g] += c
else:
dp[g] = c
print(dp[K] % M - (K == 1))