Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
29581 | diandian | Pell数列 | C++ | Compile Error | 0 MS | 0 KB | 315 | 2023-10-31 20:28:41 |
#include <bits/stdc++.h> using namespace std; int main() { long long a[1000005] = {0, 1, 2}; for (int i = 3; i <= 1000000; ++ i) a[i] = a[i - 1] * 2 + a[i - 2]; int n; cin >> a; while (n --) { int b; cin >> b; cout << a[b] % 32767; } return 0; }