結果
問題 | No.2313 Product of Subsequence (hard) |
ユーザー | prussian_coder |
提出日時 | 2023-05-24 21:06:25 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 310 bytes |
コンパイル時間 | 965 ms |
コンパイル使用メモリ | 86,368 KB |
実行使用メモリ | 123,680 KB |
最終ジャッジ日時 | 2023-08-25 13:23:31 |
合計ジャッジ時間 | 13,816 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 58 ms
75,528 KB |
testcase_01 | AC | 57 ms
70,880 KB |
testcase_02 | AC | 59 ms
70,844 KB |
testcase_03 | AC | 93 ms
76,292 KB |
testcase_04 | AC | 76 ms
76,680 KB |
testcase_05 | AC | 101 ms
76,760 KB |
testcase_06 | AC | 70 ms
76,644 KB |
testcase_07 | AC | 81 ms
76,252 KB |
testcase_08 | AC | 2,864 ms
111,708 KB |
testcase_09 | AC | 321 ms
94,228 KB |
testcase_10 | AC | 1,230 ms
114,332 KB |
testcase_11 | AC | 405 ms
90,256 KB |
testcase_12 | AC | 925 ms
115,944 KB |
testcase_13 | TLE | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
ソースコード
N,K=map(int,input().split()) import math A=[int(x) for x in input().split()] mod=998244353 dp=dict() dp[1]=1 dp2=dp.copy() for i in range(N): a=A[i] for k in dp: p = k * math.gcd(K//k,a) if not p in dp2: dp2[p]=0 dp2[p]+=dp[k] dp2[p]%=mod dp=dp2.copy() if K in dp: print(dp[K]) else: print(0)