1 条题解

  • 0
    @ 2025-4-14 18:45:29

    C++ :

    #include <cstdio>
    #include <cmath>
    void swap(int &a,int &b)
    {
    	int t;
    	t=a,a=b,b=t;
    }
    int main()
    {
    	int a,b;
    	while(scanf("%d%d",&a,&b)!=EOF)
    	{
    		if(a>b)
    			swap(a,b);
    		if(a==(int)floor((b-a)*(1+sqrt(5))/2))
    			printf("0\n");
    		else
    			printf("1\n");
    	}
    	return 0;
    }
    
    • 1

    信息

    ID
    3421
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者