有多少个长度为n的二进制串,即不存在3个连续的1,也不存在3个连续的0。
例如n = 4,共有16个长度为4的01串,其中0000 0001 1000 1111 0111 1110,不符合要求,所以共有10个符合要求的串。
输入
输入共1个数n(1 <= n <= 100000)
输出
输出结果mod 1e9+7
输入样例
4
输出样例
10
题解tql
#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
int f[100010];
int main()
{
ios::sync_with_stdio(false)