시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
4 초 | 1024 MB | 3 | 3 | 3 | 100.000% |
You are given an integer sequence $A_1,A_2,\ldots,A_N$ and an integer $K$.
You'll prepare $K$ piles of stones. Each pile should contain exactly $A_i$ piles for some $i$. All piles are distinguishable; there are $N^K$ different configurations.
You and Mike will play a game with the piles. You and Mike alternately do the following operation, with you going first.
The player who cannot make a valid move loses. Assuming both players play optimally, count the number of initial configurations that result in your loss, modulo $998244353$.
The first line contains integers $N$ ($1 \leq N \leq 100$) and $K$ ($1 \leq K \leq 10^{18}$).
The second line contains integers $A_1,A_2,\ldots,A_N$ ($1 \leq A_1 < A_2 < \cdots < A_N \leq 100$).
Print the answer.
1 7 1
1
5 100 2 3 5 7 9
842434993