数字
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
- ACM/ICPC
- Problem
- 11
- Start at
- 2024-12-7 18:30
- End at
- 2024-12-10 2:30
- Duration
- 56 hour(s)
- Host
- Partic.
- 2