Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
78598 | 杨宜炜 | PELL数列 | C++ | Accepted | 39 MS | 4172 KB | 272 | 2024-06-22 21:09:26 |
#include<bits/stdc++.h> using namespace std; int a[1000010]; int main(){ int n; cin>>n; a[1]=1; a[2]=2; for(int i=3;i<=1000000;i++){ a[i]=(a[i-1]*2+a[i-2])%32767; } for(int hndsuy=0;hndsuy<n;hndsuy++){ int k; cin>>k; cout<<a[k]<<endl; } }