|
|
вернуться в форумStrange constraint 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 Oops! I was wrong. AC without BigInteger with using c++ now :-) |
|
|