QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 256 MB Puntuación total: 100 Hackeable ✓

#8839. 敲门者

Estadísticas

众所周知,Walter 是那个敲门的人。但你知道吗?对于每一个正整数 $x$,他都可以以强度 $x$ 进行敲击。

他有一个包含正整数的数组 $a_1, a_2, \dots, a_n$。如果他以强度 $x$ 进行敲击,那么对于每个 $1 \le i \le n$,元素 $a_i$ 将被替换为 $a_i \bmod x$。

Walter 通过任意次数的敲击,总共能得到多少种不同的数组 $a_1, a_2, \dots, a_n$?由于结果可能非常大,请输出其对 $998244353$ 取模的结果。

此处 $x \bmod y$ 表示 $x$ 除以 $y$ 的余数。例如,$6 \bmod 3 = 0$,$6 \bmod 4 = 2$。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 500$),表示数组的长度。

第二行包含 $n$ 个整数 $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 500$),表示数组的元素。

输出格式

输出一个整数,表示 Walt 通过敲击能够得到的不同数组的数量。

样例

样例输入 1

1
5

样例输出 1

4

样例输入 2

2
6 5

样例输出 2

7

样例输入 3

5
1 2 4 8 16

样例输出 3

69

说明

在第一个样例中,你可以得到以下数组:$[5], [2], [1], [0]$。

在第二个样例中,你可以得到以下数组:$[6, 5], [2, 1], [1, 0], [0, 5], [0, 2], [0, 1], [0, 0]$。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.