编程介的小学生 2019-06-11 16:35 采纳率: 20.5%
浏览 93

计算所谓最佳字符串,规则如下,怎么用 C 语言的程序编写的代码设计的思想方法加以正确地实现的方法是什么

Problem Description
Given a string, you use some letters or digits to creat a new string, this new string have three properties.
1. any two adjacent letter aren't the same.
2. the new string have the biggest length.
3. the new string have the biggest lexicographical ordering.

Input
The input consists of multiple test cases. Each test case contain a string, the string is consist of 'a'~'z', 'A' - 'Z' and '0' - '9'. the length of string is not exceed 500.

Output
For each case, print the new string.

Sample Input
2
abaa
001

Sample Output
aba
010

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
    • ¥20 易康econgnition精度验证
    • ¥15 msix packaging tool打包问题
    • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致