Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3707 孙浚轩 PELL数列 C++ Wrong Answer 0 MS 260 KB 363 2024-06-23 14:59:16

Tests(0/10):


Code:

#include<iostream> using namespace std; int pell(int k){ if(k==1) return 1; else if(k==2) return 2; else{ int a=1,b=2,c; for(int i=0;i<k-2;i++){ c=(2*b+a)%32767; a=b; b=c; } return b; } } int main(){ int n; cin>>n; while(n--){ int k; cin>>k; cout<<pell(k); } return 0; }


Run Info:

------Input------
5 18887 21103 2158 24827 26729
------Answer-----
694 12629 28208 8072 16276
------Your output-----
6941262928208807216276