火柴棒拼数
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.
Background
初一竞赛组期末考题2
Description
有根火柴,种数字,数字分别需要根火柴,要求根火柴全部都用完且拼成的数字最大,输出这个数字。
Format
Input
第一行两个正整数和,第二行个正整数表示可用的数字。
Output
一行,表示能拼出的最大数字。注意数字的位数可能超过位。
Samples
20 4
3 7 8 4
777773
101 9
9 8 7 6 5 4 3 2 1
71111111111111111111111111111111111111111111111111
Limitation
对20%的数据,n≤100。
对40%的数据,n≤2000。
对100%的数据,2≤n≤10000,1≤m≤9。
1s, 1024KiB for each test case.
2023-2024第二学期初一信息竞赛组期末考
- Status
- Done
- Rule
- IOI
- Problem
- 4
- Start at
- 2024-6-24 10:45
- End at
- 2024-6-24 16:03
- Duration
- 1.5 hour(s)
- Host
- Partic.
- 41