QOJ.ac

QOJ

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

#9545. 魔法集合

Statistiques

你拥有一个初始包含 $n$ 个不同整数的神奇集合。你发现这些数字可以通过分解为它们的因子来产生能量。在每一步操作中,你可以从集合中选择任何大于 $1$ 的数字,将其移除,并插入它的一个因子。你插入的因子必须不等于原数字。此外,由于神奇集合的不稳定性,你的操作必须确保集合中的数字始终保持互不相同。

每次操作产生一个单位的能量,你的目标是通过执行尽可能多的操作来最大化产生的总能量。给定集合中的初始数字,确定可以产生的最大能量,即可以执行的最大操作次数。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 300$),表示初始集合中整数的个数。 第二行包含 $n$ 个不同的整数 $a_i$ ($1 \le a_i \le 10^9$),表示初始集合中的数字。

输出格式

输出一个整数,表示可以产生的最大能量,即可以执行的最大操作次数。

样例

样例输入 1

3
2 4 6

样例输出 1

3

样例输入 2

6
2 3 5 6 10 12

样例输出 2

3

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.