| 比赛 | NOIP2023模拟赛2 | 评测结果 | WWWWWEEEEE |
|---|---|---|---|
| 题目名称 | 铺路 | 最终得分 | 0 |
| 用户昵称 | ┭┮﹏┭┮ | 运行时间 | 3.109 s |
| 代码语言 | C++ | 内存使用 | 234.62 MiB |
| 提交时间 | 2023-11-14 11:14:28 | ||
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9+7,N = 3e7+10;
int t,n;
long long a[N] = {0,0,0,2},tot = 3;
int main(){
freopen("obsession.in","r",stdin);
freopen("obsession.out","w",stdout);
scanf("%d",&t);
for(int i = 3;i <= 2e7;i++)a[i] = (2 * (a[i-1] + a[i-2] + 1 % mod)) % mod;
while(t--){
scanf("%d",&n);
printf("%lld\n",a[n]);
}
return 0;
}