Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
83860 sh25_zhoumy Pell数列-递归 C++ 通过 0 MS 248 KB 267 2026-02-03 11:51:09

Tests(1/1):


#include<iostream> using namespace std; int pell(int n){ if(n==1||n==2) return n; else return 2*pell(n-1)+pell(n-2); } int main(){ int s,k; cin>>s; for(int i=0;i<s;++i){ cin>>k; cout<<pell(k)<<'\n'; } return 0; }


测评信息: