#P1001. [橙]M.N.G.
[橙]M.N.G.
題目描述
The number of numbers 0~9 is given. You can arrange these numbers in any order, but you must use them all. The goal is to make the final number as small as possible (note that 0 cannot be the first). For example, given 0 x2s, 1 x1s, 2 x1s, 6 x1s, and 9 x3s, the smallest number you can get is 10026999.
Now given a number, please write a program to output the smallest number that can be formed.
輸入格式
Each test case is given 10 non-negative integers in a row, in order to indicate the number of numbers with numbers 0, numbers 1, ... numbers 9. Integers are separated by a space. The total number of 10 numbers does not exceed 50, and there is at least one non-zero number.
輸出格式
Print the smallest number that can be formed in one line.
Samples
["2 1 1 0 0 0 1 0 0 3","2 1 1 0 0 0 1 0 3 0\r\n2 1 1 0 0 0 1 3 0 0"]
["10026999","10026888\r\n10026777"]
提示
M.N.G. = Minimum number of groups
備註
#LouisFox
原始資料
- Zero1 題號:
b002 - Hydro 題號:
Z1002 - Locale:
zh_TW - Display:
open