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
|
||||||||
2013-05-24 11:22:53 Himanshu
why my code is giving wrong answer |
||||||||
2012-05-21 04:57:17 Crazzyy
got AC....input has more than one number upto EOF Last edit: 2012-05-21 05:02:17 |
||||||||
2012-04-10 04:41:14 (Tjandra Satria Gunawan)(曾毅昆)
@Zhiang: for n=10000 ans is 2090 digits long :P |
||||||||
2012-04-03 09:18:31 Sharavana guru
Yup :) i got the logic, Analyze your solution... |
||||||||
2012-03-30 22:25:27 Zhiang
for n=10000 ans is 998 digits long !!! |
||||||||
2012-03-29 15:40:17 B.R.ARVIND
move to tutorial or atleast dont accept submissions in java |
||||||||
2012-03-05 04:07:42 BOND
analyze your solution.. there is something special :) |
||||||||
2012-03-02 19:31:58 MR. BEAN
ans for n=1000 is 210 digit long :) |
||||||||
2012-02-23 01:33:02 Jared Deckard
got AC, tried to bisect the solution set and my time increased... must not be very many large cases. |
||||||||
2012-02-22 03:36:36 Rachmawan Atmaji Perdana
The answer is too long... |