CF1714C.Minimum Varied Number
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Find the minimum number with the given sum of digits s such that all digits in it are distinct (i.e. all digits are unique).
For example, if s=20, then the answer is 389. This is the minimum number in which all digits are different and the sum of the digits is 20 (3+8+9=20).
For the given s print the required number.
找出满足给定数字和 s 的最小正整数,且该数的所有数字互不相同(即所有数字均唯一)。
例如,若 s=20,则答案为 389。这是所有数字互不相同且各位数字之和为 20(3+8+9=20)的最小正整数。
对于给定的 s,输出所要求的数。
输入格式
The first line contains an integer t (1≤t≤45) — the number of test cases.
Each test case is specified by a line that contains the only integer s (1≤s≤45).
第一行包含一个整数 t(1≤t≤45)—— 测试用例的数量。
每个测试用例由一行指定,该行仅包含一个整数 s(1≤s≤45)。
输出格式
Print t integers — the answers to the given test cases.
输出 t 个整数——即给定测试用例的答案。
输入输出样例
输入#1
4 20 8 45 10
输出#1
389 8 123456789 19
输入解题思路,AI测评打分。不知道怎么写?