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 1036. Lucky Tickets

A question regarding the question.....
Posted by Jaideva 10 Nov 2013 01:06
The value of N is <= 50, so we are talking about a 100 digit number atmost.....how then the upper limit of S is 1000.....shouldn't it be 900.....or are we supposed to return 0 when (2*N*9) < S.

Am I missing something ?????

Edited by author 10.11.2013 01:07

Nevermind.....I solved it.....

Few useful insights :-

(i) if S > (2*9*N) output 0;
(ii) if S = 0 output 1; (otherwise you would get WA for test 5).

Edited by author 10.11.2013 02:27