AMZRCK - Amz Rock
To many people in many cultures, music is an important part of their way of life.
AmzMohammad is a fan of rock music. and he have n rock tracks (labelled from 1 to n) now he wants to select a playlist.
In his opinion a good playlist is one that have no two successive tracks.
In how many ways?
Input
First line is the number of test cases.
Each test case in an integer n (number of tracks.)
Output
Output number of good playlists he can make.
Answer is less than 1000000000. it is the only constraint :)
Example
Input: 2 1 2 Output: 2 3
note: a good play list may consist 0 track :)
note 2: how many Persian rock tracks we have?
hide comments
Raman Shukla:
2013-11-13 14:30:58
This should be counted in one of the easiest dp problems if it is considered as a dp problem... |
|
Priyanshu Srivastava:
2013-07-27 14:42:32
At first glance,didn't think the solution could be this simple...Elegant Prob ! |
|
Unknown:
2013-07-20 09:32:28
after making n as long long got me AC |
|
Rishabh Dugar:
2013-07-20 03:39:35
nice description,,though simple soln.. |
|
Anuj_LuckFove!:
2013-05-21 18:56:41
Finally...i understood the question .. :P
|
|
Arika Saputro:
2013-05-09 15:33:49
familiar question indeed.. :p |
|
:-):
2013-04-19 14:53:22
nice dp |
|
Eduardo Nunes:
2013-04-13 18:18:02
indeed, really nice question :-D n < 43, as for 43 answer gets over 1000000000 ;-) |
|
Ouditchya Sinha:
2013-03-20 12:58:00
Nicely framed problem AC :) |
Added by: | mohammad mahmoodi |
Date: | 2012-08-01 |
Time limit: | 0.100s-1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GAWK BASH CSHARP GO ICON ICK WHITESPACE |
Resource: | AmzMohammad ( Mohammad Mahmoodi ) |