Solve Linear Recurrence
Computer Mathematics
Hard
2 views
Problem Description
Given f0,f1 and f(n)=f(n-1)+2f(n-2), compute f(n).
Output Format
One integer.
Official Solution
Iterate from 2..n using recurrence, store last two values.
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!