Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
110012 程余天皓 PELL数列 C++ Accepted 92 MS 532 KB 282 2025-02-14 10:59:11

Tests(10/10):


Code:

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