Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
112434 | 刘慕莀 | 青蛙跳台阶 | C++ | Wrong Answer | 1 MS | 260 KB | 276 | 2025-03-09 14:18:43 |
#include<bits/stdc++.h> using namespace std; long long a[51]; int main(){ int n; cin >> n; if(n<4) { a[1] = 1; a[2] = 2; for(int i = 3;i <= n;i++){ a[i] = a[i-1]+a[i-2]; } cout << a[n]+1; }else{ cout<<(n-2)*4; } return 0; }
------Input------
40
------Answer-----
549755813888
------Your output-----
152