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

Sergey AC with this formula [5] // Problem 1081. Binary Lexicographic Sequence 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)
daftcoder [Yaroslavl SU] Re: AC with this formula // Problem 1081. Binary Lexicographic Sequence 16 Oct 2011 17:46
INSANE!
I don't want to live in this world anymore.
Md. Taufique Hussain Re: AC with this formula // Problem 1081. Binary Lexicographic Sequence 3 Jun 2013 13:32
wow!!!! you probably made an easy thing too complicated.
Shubh Srivastava Re: AC with this formula // Problem 1081. Binary Lexicographic Sequence 24 May 2018 00:24
Looks like you're using golden ratio to calculate Fibonacci
Hristo Nikolaev (B&W) Re: AC with this formula // Problem 1081. Binary Lexicographic Sequence 18 Apr 2023 17:54
Way too complicated. I solved entirely using bitwise operations and an array with the first 64 Fibonacci numbers.