求助下载了一个测试点10,89输出没错啊?

P1255 数楼梯

xxiao_99 @ 2023-12-09 16:24:30

#include<iostream>
using namespace std;
int main(){
    int N,b[1000] ={0},c[1000],a[1000];
    cin>>N;
    b[0] = 1;
    c[1] = 1;
    a[1] = 0;
    for(int i = 1;i<=N;i++){
        b[0] = 1;
        for(int j = 1;j <= b[0];j++){
            b[j] = c[j]+a[j];
            b[j+1] += b[j]/10;          
            b[j] %= 10;
            if(b[j+1]) b[0]++;
        }
        for(int k = 1;k <= b[0];k++)a[k] = c[k];
        for(int k = 1;k <= b[0];k++)c[k] = b[k];            
    }
    for(int i = b[0];i > 0;i--){
        cout<<b[i];
    }
    return 0;
}

by reeceli @ 2023-12-14 10:36:28

@xxiao_99 我输出都是对的,但是过不了,我连500都过了


by the_fly_donkey @ 2024-02-19 13:24:07

我也是是这样的,不知道为什么


by zhangyf2014 @ 2024-02-26 20:06:36

me too


|