On Monday, December 17, 2012 at 3:40:11 AM UTC+5:30, Xiongqi ZHANG wrote:
> Hi thefourtheye dIVi,
> 
> Basically your idea is correct and this problem can be solved using BFS.
> 
> However, it is not sufficient to use <unsigned long long> to solve this 
> problem because the answer to 19998 is 
> 1111111111111111111111111111111111110 which is much larger than the 
> maximum number that could be represented using unsigned long long.
> 
> One more thing to note, you can keep track of all the possible remainder 
> and no need to process the remainder that has appeared before. The 
> reason for that is left for your exercise. :)
> 
> Here is the accepted code which I adapted from yours.
> 
> http://ideone.com/7ziUxy
> 
> If you have any more questions, fell free to ask.
> 
> Parker
> 
> On 2012/12/16 22:42, thefourtheye dIVi wrote:
> > I am trying to solve http://www.spoj.com/problems/ONEZERO/
> >
> > I referred so many internet posts about this, and they all talk about 
> > storing reminders and building a tree. I am running a simple BFS, 
> > nothing else... But this gets me WA :(
> >
> > http://ideone.com/SZDn5T
> >
> > Dont know whats wrong with this code. Please help me fix it.
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Google Code Jam" group.
> > To post to this group, send email to google-code@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google-code+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >

This code gives segmentation fault for input 110011

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/d5d2e562-6ac3-4846-99af-4248d4a102be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to