NECプログラミングコンテスト2022 (AtCoder Beginner Contest 267)
Ex
Odd Sum
AtCoder
⌀ 2422
原题
←G →
翻译中…

Problem Statement

翻译中…

You are given a sequence $A=(A_1,A_2,\dots,A_N)$ of length $N$.

翻译中…

Find the number, modulo $998244353$, of ways to choose an odd number of elements from $A$ so that the sum of the chosen elements equals $M$.

翻译中…

Two choices are said to be different if there exists an integer $i (1 \le i \le N)$ such that one chooses $A_i$ but the other does not.

翻译中…

Constraints

翻译中…
  • $1 \le N \le 10^5$
  • $1 \le M \le 10^6$
  • $1 \le A_i \le 10$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N M
A_1 A_2 \dots A_N

翻译中…

Output

翻译中…

Print the answer.

翻译中…

样例

Input #1
5 6
1 2 3 3 6
Output #1
3
The following $3$ choices satisfy the condition: - Choosing $A_1$, $A_2$, and $A_3$. - Choosing $A_1$, $A_2$, and $A_4$. - Choosing $A_5$. Choosing $A_3$ and $A_4$ does not satisfy the condition because, although the sum is $6$, the number of chosen elements is not odd.
Input #2
10 23
1 2 3 4 5 6 7 8 9 10
Output #2
18
题目信息
题号
abc267_h
时间限制
4 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。