首页  >  文章  >  数据库  >  Codeforces Round #219 (Div. 2) B. Making Sequences is Fun

Codeforces Round #219 (Div. 2) B. Making Sequences is Fun

WBOY
WBOY原创
2016-06-07 15:49:511420浏览

We'll define S ( n ) for positive integer n as follows: the number of the n 's digits in the decimal base. For example, S (893)?=?3 , S (114514)?=?6 . You want to make a consecutive integer sequence starting from number m ( m ,? m ??1,?...

We'll define S(n) for positive integer n as follows: the number of the n's digits in the decimal base. For example,S(893)?=?3S(114514)?=?6.

You want to make a consecutive integer sequence starting from number m (m,?m?+?1,?...). But you need to payS(nk to add the number n to the sequence.

You can spend a cost up to w, and you want to make the sequence as long as possible. Write a program that tells sequence's maximum length.

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn