1 solutions

  • 0
    @ 2025-7-19 19:36:08
    #include<bits/stdc++.h>
    using namespace std;
    typedef long long LL;
    int dx[]={-2,-2,-1,-1,1,1,2,2};
    int dy[]={-1,1,-2,2,-2,2,-1,1};
    int main()
    {
    	LL x1,y1,x2,y2;
    	cin>>x1>>y1>>x2>>y2;
    	int cnt=0;
    	for(int i=0;i<8;i++)
    	{
    		int a=x1+dx[i],b=y1+dy[i];
    		int dx=a-x2,dy=b-y2;
    		int s=dx*dx+dy*dy;
    		if(s==5)
    		{
    			cnt++;
    		}
    	}
    	if(cnt>0)
    	{
    		cout<<"Yes";
    	}
    	else
    	{
    		cout<<"No";
    	}
    	return 0;
    }
    
    • 1

    Information

    ID
    2464
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    # Submissions
    3
    Accepted
    2
    Uploaded By