题目传送门

 /*
贪心水题:首先,最少的个数为n最大的一位数字mx,因为需要用1累加得到mx,
接下来mx次循环,若是0,输出0;若是1,输出1,s[j]--;
注意:之前的0的要忽略
*/
#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
using namespace std; const int MAXN = 1e4 + ;
const int INF = 0x3f3f3f3f; int main(void) //Codeforces Round #300 A Cutting Banner
{
//freopen ("B.in", "r", stdin); char s[];
while (scanf ("%s", &s) == )
{
int len = strlen (s);
int mx = -;
for (int i=; i<len; ++i) mx = max (mx, s[i] - ''); printf ("%d\n", mx);
for (int i=; i<=mx; ++i)
{
bool ok = false;
for (int j=; j<len; ++j)
{
if (s[j] == '')
{
if (!ok) continue;
else printf ("");
}
else
{
ok = true;
printf (""); s[j]--;
}
}
if (i < mx) printf (" ");
}
puts ("");
} return ;
}

最新文章

  1. 《笨办法学C》笔记之指针
  2. plsql 查询结果窗口 不正常
  3. Csharp: read excel file using Open XML SDK 2.5
  4. 【读书笔记】iOS-KVC
  5. LU分解,Javascript代码
  6. Android视频直播解决方案(rstp、udp)
  7. MYSQL 删除字段值为NULL的语法
  8. 【转】SQLServer内部原理
  9. div+css之清除浮动
  10. [ActionScript 3.0] AS3 实现XML转换成JSON
  11. Windbg 进程与线程 《第三篇》
  12. Esper系列(十三)Splitting and Duplicating Streams
  13. 实例分析jdom和dom4j的使用和区别
  14. 学习Swift -- 错误处理
  15. static关键字使用
  16. c++自带倒置数组函数
  17. ZOJ 3702 Gibonacci number(数学推导)
  18. SVM原理以及Tensorflow 实现SVM分类(附代码)
  19. Spark2.2.0分布式集群安装(StandAlone模式)
  20. C#学习笔记-XML的读写(一)

热门文章

  1. 以DDD为开发模式的设计开发步骤可以是
  2. (转载)解决ListView中使用EditText所遇到的一些冲突
  3. hiho一下 第九十六周 数论五&#183;欧拉函数
  4. 数学复习 ---- Mathematics Notes: A Programmer&#39;s Perspective ---- by Orzer ---- 我是沙茶
  5. Balanced Teams (USACO Jan Bronze 2014)
  6. Having与Where的区别
  7. Mybatis 动态sql标签
  8. css行内样式
  9. HDU4870 Rating(概率)
  10. DisJSet:食物链(POJ 1182)