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 1225. Flags

An explanation why the doubled Fibanucci sequence is suitable here
Posted by Ivan Avdonin (Vologda ML) 11 Jan 2018 09:34
Let's define C(k,n) = n!/(k!(n-k)!).

Binomial coefficients are widely used in combinatorics. The number of ways you can place something on something is an binomial coefficient. But we can't place the blue stripe on the end of the flag and side by side.

It is well-known, that
   C(0,n) + C(1,n) + ... + C([n/2],[n/2]) = F[n+1]
where F[n+1] is (n+1)-th Fibonacci number and [n/2] is integer division [1].

I hope this my small review does not spoil you the solving of the problem. Thank you.

[1] https://en.wikipedia.org/wiki/Fibonacci_number (Use in Mathematics)

accepted/sended = 13616/35461

Edited by author 11.01.2018 10:21

Edited by author 17.06.2019 01:04

Edited by author 17.06.2019 01:04