AtCoder Regular Contest 134
E
Modulo Nim
AtCoder
⌀ 3026
原题
← DF →
翻译中…

Problem Statement

翻译中…

Snuke found a blackboard with nothing written on it.

翻译中…

He will do $N$ operations on this blackboard. In the $i$-th operation, he chooses an integer between $1$ and $a_i$ (inclusive) and writes it on the blackboard.

翻译中…

After $N$ integers are written on the blackboard, Taro The First and Jiro The Second will play a game using it. In the game, the two alternately do the operation below, with Taro The First going first.

翻译中…
  • Let $X$ be the largest integer written on the blackboard.
  • If $X=0$, the current player wins and the game ends.
  • Choose an integer $m$ between $1$ and $X$ (inclusive).
  • Replace each of the $N$ integers written on the blackboard with its remainder when divided by $m$.
翻译中…

There are $\prod_{i=1}^{N}a_i$ ways for Snuke to write numbers on the blackboard. Find the number of ways among them that will result in Taro The First's win if both players play optimally, modulo $998244353$.

翻译中…

Constraints

翻译中…
  • All values in input are integers.
  • $1 \leq N \leq 200$
  • $1 \leq a_i \leq 200$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N
a_1 a_2 \cdots a_N

翻译中…

Output

翻译中…

Print the number of ways to write integers that will result in Taro The First's win if both players play optimally, modulo $998244353$.

翻译中…

样例

Input #1
1
3
Output #1
1
- Taro The First will win only if Snuke writes $3$. - Otherwise, Taro The First can only play a move that makes the integer on the blackboard $0$.
Input #2
2
5 10
Output #2
47
Input #3
20
200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200
Output #3
273710435
- Be sure to find the count modulo $998244353$.
题目信息
题号
arc134_e
时间限制
6 s
内存限制
1024 MB

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