easyctf-2017/library/description.md

35 lines
621 B
Markdown
Raw Normal View History

2016-11-03 18:40:00 +00:00
Your librarian has a 2-row bookshelf that can contain N books in each row. She wants to know the number of ways that she can fill the bookshelf with red-colored books and blue-colored books such that no 2 red-colored books are adjacent to each other (horizontally or vertically).
2016-11-03 18:36:52 +00:00
2016-11-03 19:46:43 +00:00
Input: the integer, N (1<=N<=2^1024)
2016-11-03 18:37:58 +00:00
2017-03-11 06:11:38 +00:00
Output: the number of ways you can place red-colored books and blue-colored books onto a N-column bookshelf. Since this number might be really big, output it mod 10^9+7.
2016-11-03 18:36:52 +00:00
2017-03-11 01:19:43 +00:00
Example:
2017-03-11 06:11:38 +00:00
Input: 2
2016-11-03 18:36:52 +00:00
2017-03-11 01:19:43 +00:00
Your valid bookshelf layouts are:
```
2016-11-03 18:36:52 +00:00
BB
BB
BB
BR
BR
BB
RB
BB
BB
RB
RB
BR
BR
RB
2017-03-11 01:19:43 +00:00
```
Therefore,
2017-02-03 22:59:05 +00:00
Output: 7