最大数
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.
题目背景
求能组成的最大数是多少.
题目描述
给你一个整数 , 我们希望组成一个最大的十进制数字.
- 这个十进制数字的数位之和为
- 不能存在某一位数字为
0
- 相邻两位不同.
数据格式
输入格式
第一行输入一个整数 , 表示有 组数据.
接下来每组数据, 第一行输入一个整数
输出格式
输出 行, 每行一个整数表示最大值
样例
3
3
4
5
21
121
212
数据范围
[北辰杯 North-Star-Cup] 七月入门赛
- Status
- Done
- Rule
- Ledo
- Problem
- 6
- Start at
- 2023-7-21 18:00
- End at
- 2023-7-22 0:00
- Duration
- 6 hour(s)
- Host
- Partic.
- 91