codeforces 509C Sums of Digits
来源:互联网 发布:淘宝批量发货收费吗 编辑:程序博客网 时间:2024/06/06 03:22
codeforces 509C Sums of Digits
题意:
给出n个数字各位的加和bi,求一个严格递增的数列。要求最后一个数字最小。
如:
3 2 1 -> 3 11 100
限制:
1 <= n <= 300; 1 <= bi <=300
思路:
贪心,要求最后一个数字最小,只要保证一路过来的数字都尽量小就行。
令d=b[i]-b[i-1],
如果d>0,则从最低位填起,尽量把低位填到9
如果d<=0,则先从低位开始进位,使得d>0,然后就可以转换为第一种情况了。
0 0
- Sums of Digits - CodeForces 509 C
- Codeforces 509c Sums of Digits 贪心
- codeforces 509C Sums of Digits
- 【构造】Codeforces Round #289 509C Sums of Digits
- Codeforces 509C. Sums of Digits 贪心枚举
- codeforces 509C Sums of Digits (贪心对位操作)
- Codeforces 509C. Sums of Digits 贪心 + 模拟
- codeforces 289 C Sums of Digits
- C - Sums of Digits
- Codeforces Round #289 C. Sums of Digits(构造)
- codeforces 509C C. Sums of Digits(数位dp+贪心+枚举)
- Codeforces Round #289 (Div. 2, ACM ICPC Rules)C. Sums of Digits
- Codeforces Round #289 (Div. 2, ACM ICPC Rules)C. Sums of Digits——贪心+模拟
- Codeforces Round #289 (Div. 2, ACM ICPC Rules) C. Sums of Digits
- Codeforces Round #289 (Div. 2, ACM ICPC Rules) C. Sums of Digits
- [cf509C]Sums of Digits
- [CF]Sums of Digits
- 【Codeforces】 489C Given Length and Sum of Digits
- 项目开发经验分享—导出Excel
- 项目开发经验分享—导入Excel
- Android - AndroidManifest节点
- Modbus协议
- 把PDF转换成PPT的解决方法
- codeforces 509C Sums of Digits
- 覆盖equals时请遵守通用约定——Effective Java 读书笔记
- emwin初始化GUI_Init()进hardfault的解决办法
- poj3107 树的重心
- C#基础知识复习1代码规范-执行流程(c#)-面向对象-引用命名空间-封装-继承-访问修饰符-虚方法-静态成员-多态-抽象类等
- WinFrom Chart柱状图的使用
- Android - Toast字体修改
- nginx链表ngx_list_t
- LeetCode(160) Intersection of Two Linked Lists