| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 6124 | 李思贤 | 小明养猪的故事 | C++ | Accepted | 100 | 0 MS | 244 KB | 252 | 2020-08-23 19:56:58 |
#include <bits/stdc++.h> using namespace std; int main() { int t, n; long long a[25]; cin >> t; a[1] = 1; a[2] =2; while (t--) { cin >> n; for (int i = 3; i <= n; i++) a[i] = a[i - 1] + a[i - 2]; cout << a[n] << endl; } }