HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > APGC-1 > problem:


1. 51069 - Last Digit of a Fibonacci Number

APGC-1

Start: Feb.04.2017 at 06:00:00 PM
Finish: Feb.05.2017 at 02:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 1. 51069 - Last Digit of a Fibon...
• 2. 50458 - Weekly Report
• 3. 50742 - King Arthur II
• 4. 50930 - Tom and Jerry
• 5. 51073 - Campus Tours for High S...
• 6. 50694 - The Cheapest Flight

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 Arbli Troshani.

Last Digit of a Fibonacci Number

Your goal in this problem is to find the last digit of n-th Fibonacci number. Recall that Fibonacci numbers grow exponentially fast. For example,
  F200 = 280 571 172 992 510 140 037 611 932 413 038 677 189 525

Question:
Given an integer n, find the last digit of the nth Fibonacci number Fn› (that is, Fn mod 10).

Input specification
You will be given a number (n) first where n is between 0 and 107.

Output specification
Show the last digit with the given criteria.

Sample Input I
331
Sample Output I
9

Explanation:
 F331 = 66899.......186469
Note:
A standart algorithm may not work. Slight modification needed!


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

www.contester.ru