数字
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
给你一个 ,我们找到最少的数,其中的一部分或者全部加起来能组成 ~ 里的所有数字。
其中数字选的时候可以重复,但使用的时候不能重复。
给你 求一共需要多少个数。
有多组测试数据。
第一行一个整数 表示有 组数据。 第 到 行,每行一个整数表示 。
行,每行一个整数,表示答案
input
2
6
2
output
3
2
对于第一个样例,取数组为 ,那么:
对于第二组样例,取数组为 。 那么:
对于 % 的数据 对于所有的数据:
非常好看
- Status
- Done
- Rule
- Ledo
- Problem
- 40
- Start at
- 2025-1-24 16:45
- End at
- 2025-4-18 0:45
- Duration
- 2000 hour(s)
- Host
- Partic.
- 17