10 条题解

  • 1
    @ 2023-10-3 10:57:42
    #include <stdio.h>
    int m[1000005];
    int main()
    {
    	int a,b;
        int c=0;
        scanf("%d %d ",&a,&b);
        m[1]=1;
        m[2]=1;
        for(int i=3;;i++)
        {
            m[i]=m[i-1]+m[i-2];
            if(m[1]==a||m[2]==a)
            {
                ++c;
                c*=2;
            }
            if(a<=m[i]&&m[i]<=b)
            {
                c++;
            }
            if(m[i]>b)
            {
                break;
            }
    
        }
        printf("%d",c);
        return 0;
    }
    
    

    信息

    ID
    48
    时间
    1000ms
    内存
    128MiB
    难度
    7
    标签
    递交数
    3392
    已通过
    842
    上传者