Submit | All submissions | Best solutions | Back to list |
IWGBS - 0110SS |
Dor is IWGolymp student so he has to count in how many ways he can make N digit numbers that is formed by ones and zeroes. But zeroes can not be next to each other. Help to him in how many different numbers can he make.
For example, N = 3: 101, 010, 111, 110, 011
Note: A leading zero is allowed.
Input
A positive integer N (1 <= N <= 10000).
Output
Answer for the problem.
Example
Input: 2 Output: 3
Added by: | Azat Taryhchiyev |
Date: | 2012-02-16 |
Time limit: | 0.100s-3.085s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
hide comments
|
||||||||
2015-05-23 21:21:22 Shubham Jadhav
in python, dont forget to change the recursion limit |
||||||||
2015-04-01 19:15:17 soshika
i got accept with c++ :P |
||||||||
2014-12-07 22:07:57 Hasil Sharma
Phew !! Did it with C++ ... little hardwork but great confidence boost :) |
||||||||
2014-08-30 13:44:28 pvkcse
Easy using Python...but still i can't get how to do this with c,cpp... |
||||||||
2014-06-20 13:42:21 [Lakshman]
@shreya sahu your code is not giving correct output for sample input. For 10 answer is 144. |
||||||||
2014-06-20 13:08:14 shreya sahu
failing at 6th judge. here is my code <snip> please help Last edit: 2022-11-18 16:33:31 |
||||||||
2014-05-02 00:54:37 bahosain
@Crazzyy The input has only one number |
||||||||
2013-11-01 07:45:48 thangagiriarasan
easy to do in python than in c or c++ |
||||||||
2013-05-26 12:59:11 Ouditchya Sinha
Nice way of presenting the problem, for n = 10000, the answer is 2090 digits long. :) |