Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139220 李朋秦 PELL数列 C++ Accepted 109 MS 660 KB 492 2025-12-05 17:11:13

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,k,a[100001]={}; cin>>n; a[1]=1;a[2]=2; for(int i=0;i<n;i++){ cin>>k; for(int j=3;j<=k;j++){ a[j]=(a[j-1]*2+a[j-2])%32767; } cout<<a[k]<<endl; } return 0; }