1 solutions

  • 0
    @ 2025-11-5 19:41:41

    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

    Information

    ID
    19554
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By