ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1564. Counting Ones

Strange constraint
Posted by [Ural SU] GetTester 16 Nov 2009 13:41
Obvious solution looks as:
1) Suggest f(n) = amount of ones in numbers from 1 to n
2) Make binary search for f(i)
It is obvious right, but constraint for input number don't allow to fast writing this solution in cpp (because we need in BigInteger). So, in my opinion, constraint are bad.
If we want to make hardships with standart types in cpp and pascal, should take 1 <= n <= 10^100. In other hand, if we don't want to make it, should take 1 <= n <= 10^15.

Am I wrong?
Re: Strange constraint
Posted by [Ural SU] GetTester 20 Nov 2009 04:03
Oops! I was wrong. AC without BigInteger with using c++ now :-)