hello,i want to know that how these peoples know the answers in advance see this solution.I have no idea how she calculated or get these values.See array mouni of the solution.question link
Actually for this problem, pre-calculation is very easy. We need to find the N th term is series 3, 4, 33, 34, 43, 44, 333, 334, 343, 344, 433, 434, 443, 444, 3333, 3334, 3343, 3344……. and constraint for N is N <= 100. So one can find all the combinations easily.
Generate the series ( first 100 terms ) using brute force ( or some other method ), store the values in a file ( maybe write a program for this ) then copy/put the values is an array and Voila!! we are done. N <= 100 is well below the size limit of submission.
Well it’s easy.
You can precompute the values , store the values in a file and then copy from that file to the array in the code.
Or
Do it manually if you have the time.
See this i used simple decimal to binary conversion…
here 0 maps to 3 and 1 maps to 4!!
My Submission in Python: http://www.codechef.com/viewsolution/6318989
thanks…
thanks for reply…but personally i don’t find it efficient or you can say the best way…What do you think
WOW man !!! I am impressed, you did a very nice thing, I also should have thought about this. Anyways +1 for sharing this procedure.
Lol it took half hour for me to understand this relation!!
i want to give +10.Nice
Nice, isn’t it brute force?
Don’t know bro…what this technique called… this was the first thing that came to my mind.
After looking at your solution i am doubtful that are you really a newbie??
Nice Code…
thanks for the complement But not as awesome as yours God code_/_
can u pls tell (or) show the c++ code for generating all such numbers uptill 100 by burte force method?
pls help… i am not getting
@shiva_google here is the solution.You asked @mediocoder but i am giving answer i hope you don’t mind bro .Correct me anybody if i am wrong
Thank you bro
i never mind
who ever answers one thing remains the same => GAINING SOME KNOWLEDGE
i think u generated 1000000000 numbers right? but 100 is enough according to the question?anyways this is not a problem at all
and one more doubt, in check function y did u take a copy of x … temp=x?
LOL my code is not at all awesome bro…!! just because i was not able to implement brute-force algorithm so i thought of an alternative…