大佬们求助,9个RE,下载数据本地能过

P1255 数楼梯

zhangyf2014 @ 2024-02-25 21:43:34

#include<bits/stdc++.h>
using namespace std;
int a[50500],b[50500],c[50500];
int len = 1;
int jia(){
    int j = 0;
    for(int i = 1;i <= len;i ++){
        c[i] = b[i] + a[i] + j;
        j = c[i] / 10;
        c[i] %= 10;
    }
    if(j != 0){
        len ++;
        c[len] = j;
    }
    for(int i = 1;i <= len;i ++){
        a[i] = b[i];
        b[i] = c[i];
    }
}
int main(){
    int n;
    cin>>n;
    a[1] = 1;
    b[1] = 1;
    for(int i = 2;i <= n;i ++) jia();
    for(int i = len;i >= 1;i --) cout<<b[i];
    return 0;
}

|