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
hide comments
Shubham Jadhav:
2015-05-23 21:21:22
in python, dont forget to change the recursion limit |
|
soshika:
2015-04-01 19:15:17
i got accept with c++ :P |
|
Hasil Sharma:
2014-12-07 22:07:57
Phew !! Did it with C++ ... little hardwork but great confidence boost :) |
|
pvkcse:
2014-08-30 13:44:28
Easy using Python...but still i can't get how to do this with c,cpp... |
|
[Lakshman]:
2014-06-20 13:42:21
@shreya sahu your code is not giving correct output for sample input. For 10 answer is 144. |
|
shreya sahu:
2014-06-20 13:08:14
failing at 6th judge. here is my code <snip>
|
|
bahosain:
2014-05-02 00:54:37
@Crazzyy
|
|
thangagiriarasan:
2013-11-01 07:45:48
easy to do in python than in c or c++ |
|
Ouditchya Sinha:
2013-05-26 12:59:11
Nice way of presenting the problem, for n = 10000, the answer is 2090 digits long. :) |
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 |