A10661 | Festival Organization
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
The Prodiggers are quite a cool band and for this reason, they have been the surprise guest at the ENTER festival for the past 80 years. At the beginning of their careers, they weren’t so successful, so they had to spend time digging channels to earn money; hence the name. Anyway, they like to tour a lot and have surprising amounts of energy to do extremely long tours. However, they hate spending two consecutive days without having a concert, so they would like to avoid it.
A tour is defined by a sequence of concerts and days-off. You need to count in how many ways The Prodiggers can select $k$ different tours of the same length between $l$ and $r$ .
For example if $k=2$ , $l=1$ and $r=2$ , if we define concert day as {1} and day-off as {0}, here are all possible tours: {0}, {1}, {00}, {01}, {10}, {11}. But tour 00 can not be selected because it has $2$ days-off in a row. Now, we need to count in how many ways we can select $k=2$ tours of the same length in range $[1;2]$ . Here they are: {0,1}; {01,10}; {01,11}; {10,11}.
Since their schedule is quite busy, they want you to tell them in how many ways can do that, modulo $1000000007$ ( $10^{9}+7$ ).
A tour is defined by a sequence of concerts and days-off. You need to count in how many ways The Prodiggers can select $k$ different tours of the same length between $l$ and $r$ .
For example if $k=2$ , $l=1$ and $r=2$ , if we define concert day as {1} and day-off as {0}, here are all possible tours: {0}, {1}, {00}, {01}, {10}, {11}. But tour 00 can not be selected because it has $2$ days-off in a row. Now, we need to count in how many ways we can select $k=2$ tours of the same length in range $[1;2]$ . Here they are: {0,1}; {01,10}; {01,11}; {10,11}.
Since their schedule is quite busy, they want you to tell them in how many ways can do that, modulo $1000000007$ ( $10^{9}+7$ ).
输入格式
The first line of the input contains three integers $k$ , $l$ and $r$ ( $1<=k<=200$ , $1<=l<=r<=10^{18}$ ).
输出格式
Output a single number: the number of ways to select $k$ different tours of the same length, modulo $1000000007$ .
输入输出样例
输入 #1
1 1 2
输出 #1
5
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted