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 1081. Binary Lexicographic Sequence

AC with this formula
Posted by Sergey 9 Oct 2011 01:01
I've used this formula to solve this problem:
a(n) = 2^(b(n)-1) + a(n - c(1+b(n)))
b(n) = -1+floor(log(((n+0.2)*sqrt(5)))/log((1+sqrt(5))/2));
c(0) = 0, c(1) = 1, c(n) = c(n-1) + c(n-2)
Re: AC with this formula
Posted by daftcoder [Yaroslavl SU] 16 Oct 2011 17:46
INSANE!
Re: AC with this formula
Posted by htzfun 1 May 2012 17:44
I don't want to live in this world anymore.
Re: AC with this formula
Posted by Md. Taufique Hussain 3 Jun 2013 13:32
wow!!!! you probably made an easy thing too complicated.
Re: AC with this formula
Posted by Shubh Srivastava 24 May 2018 00:24
Looks like you're using golden ratio to calculate Fibonacci
Re: AC with this formula
Posted by Hristo Nikolaev (B&W) 18 Apr 2023 17:54
Way too complicated. I solved entirely using bitwise operations and an array with the first 64 Fibonacci numbers.