AT_ndpc2026_j.Number and Total
入门
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given a sequence of positive integers A=(A1,A2,…,AN) of length N, and positive integers S and T.
Find the number of sequences of non-negative integers (c1,c2,…,cN) that satisfy all of the following conditions, modulo 998244353:
- c1+c2+⋯+cN=S
- A1c1+A2c2+⋯+ANcN=T
给你一个长度为 N 的正整数序列 A=(A1,A2,…,AN),以及两个正整数 S 和 T。
求满足以下所有条件的非负整数序列 (c1,c2,…,cN) 的个数(对 998244353 取模):
- c1+c2+⋯+cN=S
- A1c1+A2c2+⋯+ANcN=T
输入格式
The input is given from standard input in the following format:
N S T
A1 A2 … AN
输入从标准输入中按以下格式给出:
N S T
A1 A2 … AN
输出格式
Print the number of sequences of non-negative integers (c1,c2,…,cN) that satisfy the conditions, modulo 998244353.
输出满足条件的非负整数序列 (c1,c2,…,cN) 的个数,对 998244353 取模。
输入输出样例
输入#1
4 4 10 1 2 3 4
输出#1
5
输入#2
10 34016955048482281 206283256471036323 38 35 28 54 3 15 4 16 6 1
输出#2
230312634
说明/提示
Sample 1 Explanation:
The following 5 sequences satisfy the conditions:
- (0,2,2,0)
- (0,3,0,1)
- (1,0,3,0)
- (1,1,1,1)
- (2,0,0,2)
Constraints
- 1≤N≤20
- 1≤S≤1018
- 1≤T≤1018
- 1≤Ai≤200
- i=1∑NAi≤200
- All input values are integers
样例 1 解释:
以下 5 个序列满足条件:
- (0,2,2,0)
- (0,3,0,1)
- (1,0,3,0)
- (1,1,1,1)
- (2,0,0,2)
限制条件
- 1≤N≤20
- 1≤S≤1018
- 1≤T≤1018
- 1≤Ai≤200
- i=1∑NAi≤200
- 所有输入值均为整数
输入解题思路,AI测评打分。不知道怎么写?