|
|
back to boarddynamic solution Posted by Zero 11 Oct 2011 16:42 f(i,red)=f(i-2,white)+f(i-1,white) f(i,white)=f(i-2,red)+f(i-1,red) Use long long because when n=45 the answer exceeds maxlongint. Re: dynamic solution 1) ...and we get just doubled fibonacci sequence. 2) unsigned long is enough ;) |
|
|