提交时间:2023-10-10 14:05:25

运行 ID: 106277

#include <bits/stdc++.h> using namespace std; int len = 1; int CZX[1005][1005]; int n,m; void add(int x) { for(int i = 1;i <= len;i++)CZX[x][i] = CZX[x - 1][i] + CZX[x - 2][i]; for(int i = 1; i <= len; i++) { if(CZX[x][i] > 9) { CZX[x][i + 1] += CZX[x][i] / 10; CZX[x][i] %= 10; } } if(CZX[x][len + 1])len++; } signed main() { cin >> n >> m; CZX[1][1] = 1; CZX[2][1] = 2; for(int i = 3;i <= m - n;i++)add(i); for(int i = len;i >= 1;i--)cout << CZX[m - n][i]; return 0; }