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

Tests(0/10):


Code:

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


Run Info:

Runtime Error:Segmentation fault