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
|
||||||||
2017-01-16 18:19:02
Iterative dp + BigInteger in Java :) |
||||||||
2016-12-31 10:45:06
Thanks for the problem learnt how to use BIGINT |
||||||||
2016-08-22 10:42:11
:D |
||||||||
2016-07-11 21:06:47
easy in python if u get the dp relation! |
||||||||
2016-03-12 12:21:48 arthur
I have seen more tougher dp problems. |
||||||||
2015-12-26 07:49:40 SHIVEK SACKLECHA
My 50th problem :) |
||||||||
2015-11-05 19:59:29 Mayank Garg
Easy one but in java ;) |
||||||||
2015-08-14 09:43:31 Shubham Jain
my 100 :) an easy task with BigInteger |
||||||||
2015-07-06 16:27:35
1 day + 55 line in c++ = AC in one go!!! |
||||||||
2015-06-11 15:33:23 :.Mohib.:
5 lines in python ;) Solved in c :) Last edit: 2015-06-11 16:15:28 |