HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > SEM 2 - W5 > problem:


50727 - Fibonacci Numbers

SEM 2 - W5

Start: Apr.04.2023 at 04:12:08 PM
Finish: Apr.10.2023 at 08:12:08 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 50727 - Fibonacci Numbers
• 50782 - Max of N integers
• 50554 - nth power of m
• 50783 - The smallest number
• 1. 50381 - Sum of the numbers

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Fibonacci Numbers

Although first described in India, The Fibonacci sequence has become famous after Fibonacci introduced it in his book Liber Abaci. Except the first two numbers (Fibonacci(0)=1 and Fibonacci(1)=1), Fibonacci numbers are formed as the sum of previous 2 Fibonacci numbers.
Fibonacci(2)= Fibonacci(1) + Fibonacci(0);
Fibonacci(3)= Fibonacci(2) + Fibonacci(1);
Fibonacci(4)= Fibonacci(3) + Fibonacci(2);
etc..

Question:
Write a program that calculates nth element of the Fibonacci sequence.

Input specification
You will be given one integer number (n) where 0 ≤ n ≤ 30

Output specification
Show one integer number which is nth element of the Fibonacci sequence.

Sample Input I   
  5
Sample Input II   
  12
Sample Output I   
  8
Sample Output II   
  233


Для отправки решений необходимо выполнить вход.

www.contester.ru