4 条题解

  • 0
    @ 2024-4-12 21:02:00

    #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int>su(n+1); for (int i = 1; i <= n; i++)cin >> su[i]; int way[1001]; way[1] = 0; way[2] = 1; way[3] = 2; for (int i = 1; i <= n; i++) { for (int j = 4; j <= su[i]; j++) way[j] = way[j - 1] + way[j - 2]; cout << way[su[i]] << endl; }

    return 0;
    

    }

    信息

    ID
    129
    时间
    1000ms
    内存
    256MiB
    难度
    5
    标签
    递交数
    292
    已通过
    113
    上传者