Submit | All submissions | Best solutions | Back to list |
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?
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 ) |
hide comments
|
|||||||||
2013-02-08 14:52:50 me codesta a.k.a w@s!m
can anyone explain first test case ? |
|||||||||
2013-01-27 21:07:06 strings
nyc way to put the question !! |
|||||||||
2012-11-02 23:22:17 Smithers
Hopefully this should be a bit clearer: A play-list is any (possibly empty) set taken from the n tracks. Re-orderings are considered to be the same play-list. A good play-list is one which does not, for any i, contain both tracks i and i+1. At least, I got AC under those assumptions, so if the meaning is different then it has the same answer. :) The wording in the question was a bit unclear: I first read "a good playlist is one that have no two successive tracks" to mean "a good playlist has at most one track"; notice that the sample input does not dispel this myth! |
|||||||||
2012-10-22 01:09:19 David adroy
plzz explain d test cases...plzzz |
|||||||||
2012-10-08 19:35:00 termin
plzzzzz give me some more test casee. i got WA, so plzzzz |
|||||||||
2012-09-25 02:40:16 Sardar Khan
simple observation !! |
|||||||||
2012-09-06 20:06:10 Vikas Kushwaha
geting WA for my solution id 7604510. pls check..is there any special case got ac...correct data type to be selected :D Last edit: 2012-09-09 05:02:19 |
|||||||||
2012-08-28 19:12:06 3qu@t!0n
oh! finally got AC :) Last edit: 2013-01-31 20:17:20 |
|||||||||
2012-08-23 07:38:48 :D
It's should be rephrased to: "a good play list may be empty." |