Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139222 李明秦 PELL数列 C++ Accepted 108 MS 412 KB 258 2025-12-05 17:13:38

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n,k,a[1000001]; cin>>n;a[1]=1;a[2]=2; for(int i=1;i<=n;i++){ cin>>k; for(int j=3;j<=k;j++){ a[j]=(2*a[j-1]+a[j-2])%32767; } cout<<a[k]<<endl; } return 0; }