Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
65426 万正钰 PELL数列 C++ Runtime Error 2 MS 276 KB 396 2024-01-25 16:14:12

Tests(0/10):


Code:

#include<algorithm> #include<iostream> #include<cstring> #include<cmath> #include<iomanip> using namespace std; int a[1000],b[1000]={1,2},n,m,ans=0; int main(){ cin>>m; for(int i=2;i<=1000;i++){ b[i]=2*b[i-1]+b[i-2]; b[i]=b[i]%32767; } for(int i=1;i<=m;i++) { cin>>n; cout<<b[n-1]; } return 0; }


Run Info:

Runtime Error:Segmentation fault