QOJ.ac

QOJ

Limite de temps : 1.0 s Limite de mémoire : 512 MB Points totaux : 100 Hackable ✓

#7304. 硬币 2

Statistiques

在 ICPCCamp,人们通常使用面值为 $1, 2, 3, \dots, n$ 的硬币。 Bobo 很穷,他分别只有 $a_1, a_2, a_3, \dots, a_n$ 枚面值为 $1, 2, 3, \dots, n$ 的硬币。他购买了一件价值未知的物品,且购买时没有找零。 该未知物品的价值为非负整数。请找出该物品价值可能的取值数量。

输入格式

输入包含零个或多个测试用例,并以文件结束符(EOF)终止。对于每个测试用例: 第一行包含一个整数 $n$ ($1 \le n \le 15$)。 第二行包含 $n$ 个整数 $a_1, a_2, \dots, a_n$ ($0 \le a_i \le 10^9$)。 保证测试用例的数量不超过 $100$,且至多有一个测试用例满足 $n > 10$。

输出格式

对于每个测试用例,输出一个整数,表示可能取值的数量。

样例

样例输入 1

3
0 1 2
3
0 2 3

样例输出 1

6
12

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.